mardi 21 juin 2016

Laravel 5.2 auth middleware on protected routes - show message

I'm using auth middleware in my routes.php as recommended to enforce login for protected routes.

Route::group(['middleware' => 'auth'], function () {
Route::resource('message', 'MessageController');
});

So when a protected route is requested if the user is not logged in then the login screen is displayed.

In this scenario I would like to add a a to the login view saying something like-

'The page you have requested requires you to login.'

If possible I would also like to include the URL that the user has requested.

Any ideas as to how I could achieve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire