“Laravel Routengruppe” Code-Antworten

Laravel Route :: Gruppendefinition

Route::group(['prefix'=>'accounts','as'=>'account.'], function(){
    Route::get('/', 'AccountController@index')->name('index');
    Route::get('connect', 'AccountController@connect')->name('connect');
});

Route::group(['prefix'=>'quotes','as'=>'quote.'], function(){
    Route::get('/', 'QuoteController@index')->name('index');
    Route::get('connect', 'QuoteController@create')->name('create');
});
Depressed Deer

Laravel Routen -Namespace und Präfix

Route::prefix('admin')->group(function () {
    Route::get('/users', function () {
        // Matches The "/admin/users" URL
    });
});
Perfect Plover

Routengruppencontroller Laravel

use App\Http\Controllers\OrderController;
 
Route::controller(OrderController::class)->group(function () {
    Route::get('/orders/{id}', 'show');
    Route::post('/orders', 'store');
});
Irfan

Laravel Group Routen

Route::group(['prefix' => 'admin'], function () {
    Route::get('users', function ()    {
        // Matches The "/admin/users" URL
    });
});
Almabek

Laravel Routengruppenname

Route::group(['prefix'=>'accounts','as'=>'account.'], function(){
    Route::get('/', ['as' => 'index', 'uses' => 'AccountController@index']);
    Route::get('connect', ['as' => 'connect', 'uses' = > 'AccountController@connect']);
});
Yucky Yak

Laravel Routengruppe

Route::middleware(['first', 'second'])->group(function () {
    Route::get('/', function () {
        // Uses first & second middleware...
    });
 
    Route::get('/user/profile', function () {
        // Uses first & second middleware...
    });
});
Silly Seahorse

Ähnliche Antworten wie “Laravel Routengruppe”

Fragen ähnlich wie “Laravel Routengruppe”

Weitere verwandte Antworten zu “Laravel Routengruppe” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen