In new laravel I can't get session in constructor. Why?
public function __construct()
{
dd(Session::all()); //this is empty array
}
and then below
public function index()
{
dd(Session::all()); //here works
}
In old laravel i remember there was not this problem. something changed?
You can't do it by default with Laravel 5.3. But when you edit you
Kernel.php
and changeprotected $middleware = [];
to the following it wil work.Hope this works!