1Route::prefix('admin')->group(function () {
2 Route::get('/users', function () {
3 // Matches The "/admin/users" URL
4 });
5});
1Route::pattern('id', '[0-9]+');
2Route::get('user/{id}', function ($id) {
3 // Only executed if {id} is numeric...
4});
1Route::name('admin.')->group(function () {
2 Route::get('/users', function () {
3 // Route assigned name "admin.users"...
4 })->name('users');
5});
1Route::get('user/{id}/profile', function ($id) {
2 //
3})->name('profile');
4
5$url = route('profile', ['id' => 1, 'photos' => 'yes']);
6
7// /user/1/profile?photos=yes
1Route::match(['get', 'post'], '/', function () {
2 //
3});
4
5Route::any('/', function () {
6 //
7});
1Route::get('posts/{post}/comments/{comment}', function ($postId, $commentId) {
2 //
3});