Reputation: 53
I'm new to Laravel and as said in the title I can't find the Authenticate Middleware. I know it should be in app/http/middleware/Authenticate, as it was in previous projects, but it's not there. The ones that are there are: Encrypt.. , RedirectifAuth.. and VerifyCsrf... I hope you can help me locate it.
Upvotes: 1
Views: 3229
Reputation: 39
Laravel 5.2
'app/http/middleware/Authenticate.php'
Laravel 5.3
'app/exceptions/handler.php'
Upvotes: 3
Reputation: 1163
Unless you have a solid understanding of what you're doing it is not recommended that you move or overwrite files within the vendor folder.
That being said, you CAN overwrite the Authenticate.php file and just modify your Kernel.php file:
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class, <--Change this Directory
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
...
];
To:
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class, <--- There you go
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
...
];
Be sure to copy and paste the code from the Authenticate file in the vendor folder into the Authenticate file in your app\http\middleware directory to resume the same functionality.
Again it's not recommended you do this unless you have a solid understanding of what you're doing and how it all works.
Upvotes: 3