1Route::middleware(['first', 'second'])->group(function () {
2 Route::get('/', function () {
3 // Uses first & second middleware...
4 });
5
6 Route::get('/user/profile', function () {
7 // Uses first & second middleware...
8 });
9});
1Route::group(['prefix' => 'admin'], function () {
2 Route::get('users', function () {
3 // Matches The "/admin/users" URL
4 });
5});
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::get('/novanoticia', 'HomeController@getNovaNoticia')->name('route_name');
2Route::get('/novanoticia', ['as' => 'route_name', 'uses' => 'HomeController@getNovaNoticia']);
3
1Route::get($uri, $callback);
2Route::post($uri, $callback);
3Route::put($uri, $callback);
4Route::patch($uri, $callback);
5Route::delete($uri, $callback);
6Route::options($uri, $callback);