laravel route grouping code example
Example 1: laravel route namespace and prefix
Route::prefix('admin')->group(function () {
Route::get('/users', function () {
});
});
Example 2: group routes in laravel
Route::middleware(['first', 'second'])->group(function () {
Route::get('/', function () {
});
Route::get('/user/profile', function () {
});
});
Example 3: laravel group routes
Route::group(['prefix' => 'admin'], function () {
Route::get('users', function () {
});
});
Example 4: set route name laravel
Route::get('/novanoticia', 'HomeController@getNovaNoticia')->name('route_name');