Answers for "laravel route pattern"

PHP
4

laravel route

Route::get('user/{id}', function ($id) {
    return 'User '.$id;
});
Posted by: Guest on April-22-2020
2

laravel route

Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
Posted by: Guest on October-07-2020
2

laravel route pattern

Route::pattern('id', '[0-9]+');
Route::get('user/{id}', function ($id) {
    // Only executed if {id} is numeric...
});
Posted by: Guest on May-18-2020
0

laravel route

Route::get('posts/{post}/comments/{comment}', function ($postId, $commentId) {
    //
});
Posted by: Guest on April-22-2020

Browse Popular Code Answers by Language