Middleware auth did not work.

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('/', 'ExampleController@index')->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;