jeudi 24 décembre 2015

Is there any clean way to isolate the admin routes ? : laravel 5.1

My code is below in Routes.php

Route::group([
    'middleware' => 'auth',
], function() {

    Route::get('/Categories-List', 'Category_Controller@index');
    Route::get('/Create-Category', 'Category_Controller@create');
    Route::post('/SaveCategory', 'Category_Controller@store')->middleware(['isAdmin']);
    Route::post('/UpdateCategory', 'Category_Controller@update')->middleware(['isAdmin']);
});

What's the problem ?

There are still other 100s of routes defined which contains many belongs to admin.

Is there any clean way to isolate the admin routes ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire