How to Auth::check() user on Laravel with API calls
问题 I'm using VueJS in my front-end, so I have this API call somewhere in the front-end code: let products = axios.get('api/products'); And then in the routes/api.php :- Routes::get('products', 'ProductsController@index'); in the ProductsController 's index method: public function index () { if ( Auth::check() ) { $user = Auth::user(); return $user->products; } // return 'You don't have any products right now!'; } The index method will always return null even if the user is logged-in! So how to