Answer
In the first flow, you have to create a custom middleware using this command
php artisan make:middleware Admin
Then add middle route in kernal file :- app >> Http >> Kernel.php
Add this in $routeMiddleware array
protected $routeMiddleware = [
'admin' => \App\Http\Middleware\Admin::class,
];
after that add this admin route middleware to our route
Route::get('admin/routes', 'HomeController@admin')->middleware('admin');
You can put your logic in this controller, so whenever any route call from this inside this route first call our middleware
For more explanation reference the below link :
0 comments:
Post a Comment
Thanks