add middle ware in route laravel code example
Example 1: laravel make middleware
php artisan make:middleware CheckAge
Example 2: how to attach the middleware to a route definition
Route::get('profile', function () {
// Only verified users may enter...
})->middleware('verified');