Auth::user() returns null in Laravel 5.2
I have searched and found various results like these: auth()->user() is null in Laravel 5.2 and Auth::user() returns null But, mine is still not working. Auth::user() works in the controller, but not in the Model. It returns null . The code is: public function scopeOwned($query) { $query->where('user_id', '=', Auth::user()->id); } I tried dd(Auth::user()) and it returns null as well. Any Idea? Thank you guys. The problem solved here: https://laracasts.com/discuss/channels/laravel/authuser-returns-null-in-laravel-52 I had to add the stack into middleware directly (not in the group). in /Http