I am trying to create a cookie in laravel 5 with
$cookie = Cookie::make('name', 'value');
in controller and i want to attach to the view. But it shows the error
Class 'App\Http\Controllers\Cookie' not found.
How to solve this problem ?
Most Class not found
are usually caused my incorrect namespace:
try
$cookie = \Cookie::make('name', 'value');
or add use Cookie;
in your class like so:
<?php namespace App\Http\Controllers;
use Cookie;
UserController extends Controller{
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With