[Vuejs]-I Want To Get The Logged In User in my Controller

0👍

If the authenticated user is null, it is most likely that you haven’t passed this route through the auth middleware. In your web.php (or api.php if this is an api route), make sure whatever route you are using is within that middleware. So, if this is a postCreate route for example, it might look something like this:

Route::group(['middleware' => ['auth']], function () {

    Route::get('yourPostCreateRoute', 'YourPostController@index');
    // etc.
}

Leave a comment