Laravel - Authentication - Protecting Routes

Route middleware can be used to only allow authenticated users to access a given route. Laravel ships with an auth middleware, which references the Illuminate\Auth\Middleware\Authenticate class. Since this middleware is already registered in your application's HTTP kernel, all you need to do is attach the middleware to a route definition:

    
    Route::get('/flights', function () {
        // Only authenticated users may access this route...
    })->middleware('auth');