1Route::prefix('admin')->group(function () {
2 Route::get('/users', function () {
3 // Matches The "/admin/users" URL
4 });
5});
1Route::get('/novanoticia', 'HomeController@getNovaNoticia')->name('route_name');
2Route::get('/novanoticia', ['as' => 'route_name', 'uses' => 'HomeController@getNovaNoticia']);
3
1Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
1// You can make a parameter optional by placing a '?' after the parameter name.
2// Make sure to give the route's corresponding variable a default value:
3Route::get('user/{name?}', function ($name = null) {
4 return $name;
5});
6
7Route::get('user/{name?}', function ($name = 'John') {
8 return $name;
9});