laravel controller constructor auth user null

Solutions on MaxInterview for laravel controller constructor auth user null by the best coders in the world

showing results for - "laravel controller constructor auth user null"
Giorgio
03 Aug 2017
1class BaseController extends Controller
2{
3    public $user_info;
4  
5    public function __construct(){
6      $this->middleware(function ($request, $next) {
7        $this->user_info=Auth::user(); // returns user
8        return $next($request);
9      });
10    }
11}