Thursday, April 13, 2017

Error while using laravel 5.4 session

I am new to laravel session:

here is my code to get session:

Session::set('user_id', $user);
$session_id = Session::get('user_id');
echo $session_id;exit;

Included namespaces:

use Illuminate\Http\Request;use Illuminate\Support\Facades\Session;use App\Role;use App\User;use DB;

Error is:

FatalThrowableError in Manager.php line 137: Call to undefined method Illuminate\Session\Store::set()

Thanks to all for any help.



via Hazrat Bilal

Advertisement