Wyatt
0
Q:

laravel route pattern

# Using Request
Route::get('user/{name}', function (Request $request) {
    return $request->route('name');
});
4
Route::get('user/{id}', function ($id) {
    return 'User '.$id;
});
2
Route::pattern('id', '[0-9]+');
Route::get('user/{id}', function ($id) {
    // Only executed if {id} is numeric...
});
2
Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
2
Route::view('/welcome', 'welcome');

Route::view('/welcome', 'welcome', ['name' => 'Taylor']);
0

New to Communities?

Join the community