### Authorize and Show Flight in Laravel Controller Source: https://laravel.com This controller method demonstrates attribute-based authorization and displays flight information. It requires authentication and authorization for viewing a specific flight. ```PHP class FlightController { #[Middleware('auth')] #[Authorize('view', 'flight')] public function show(Flight $flight): View { return view('dashboard', ['user' => $user]); } } ``` -------------------------------- ### Define Authenticated Route in Laravel Source: https://laravel.com Use this to define a route that requires user authentication. It returns a view with the authenticated user's data. ```PHP Route::get('/dashboard', function (Request $request) { $user = $request->user(); return view('dashboard', ['user' => $user]); })->middleware('auth'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.