Route::get('user/{id}', function ($id) {
return 'User '.$id;
});
Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
Route::pattern('id', '[0-9]+');
Route::get('user/{id}', function ($id) {
// Only executed if {id} is numeric...
});
Route::view('/welcome', 'welcome');
Route::view('/welcome', 'welcome', ['name' => 'Taylor']);
// before: http://yourdomain.test/routename
secure_url(route("routename", ["querystring" => "something"], false));
// after: https://yourdomain.test/routename?querystring=something
Route::get('posts/{post}/comments/{comment}', function ($postId, $commentId) {
//
});
Laravel_Route::
Route::get('/user/{id}/profile', function ($id) {
//
})->name('profile');
$url = route('profile', ['id' => 1, 'photos' => 'yes']);
// /user/1/profile?photos=yes