laravel route ->as( code example
Example 1: laravel get route
Route::get('/user', 'UserController@index');
Example 2: laraval routing
use App\Http\Controllers\UserController;
use App\Models\User;
// Route definition...
Route::get('/users/{user}', [UserController::class, 'show']);
// Controller method definition...
public function show(User $user)
{
return view('user.profile', ['user' => $user]);
}