Middleware auth did not work.

Last modified on August 23, 2019 20 sec read

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:


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.