Middleware auth did not work.

Last modified on August 23, 2019 20 sec read

HIRE US 🖐
We're available to do freelance project. Take a look at our services!

It’s a crucial part laravel project. It needs to check to protect my path of laravel.

In routes->web.php here I declare all my path link, for best practicing I use route grouping.

Route::group(['prefix' => 'example', 'middleware'=>'auth'], function () {
   Route::get('/', '[email protected]')->name('example');
 });

But the problem I face it did not check any authentication. The solution I found that is, go to your

Here is Folder structure:

app->Exceptions->Handler.php

then you just this this class 🙂

use Illuminate\Auth\AuthenticationException;

Monthly Newsletter

One email a month, packed with the latest tutorials, delivered straight to your inbox.
We'll never send any spam or promotional emails.

Leave a Reply

Your email address will not be published. Required fields are marked *