Skip to content
Advertisement

Tag: laravel-5

How to create and destroy cookie in Laravel 5.7?

I am a novice in Laravel, I have made a simple hello program in Laravel and I want to use a cookie in my program. How do I create and delete a cookie in Laravel? Also, how do I set session in Laravel? Answer Set cookie: Cookie::queue(Cookie::make(‘cookieName’, ‘value’, $minutes)); Get cookie: $value = $request->cookie(‘cookieName’); or $value = Cookie::get(‘cookieName’); Forget/remove cookie:

How to print table data in Laravel 5.6?

in My Larvel 5.6 app I am working with mysql db. and in my application I have vehicle table with following columns, vehicles, and I am going to group all models of the table and printing here as My controller, my printing blade file is this, it is printing well as now I need print in-front of model name there

How can I show subcategories in categories?

Here’s the code: I will like to display parent category and its children under it. Something like this: Category Sub 1 Sub 2 Category – Sub 1 – Sub 2 I want to show data like see demo Database Structure. Both categories and subcategories are in same table. Database Answer Try this: Output:

Laravel UUID’s and their uniqueness?

I have two tables, one for lists and another that stores a history of lists that were created. These lists are very temporary and they can be deleted by numerous methods so I add a reason field on the history for that. Now both have a uuid field and I can generate an actual string to store with Laravel’s helper

Advertisement