mardi 14 février 2017

Better way to add route class under the same group

I am using Laravel 5.4

Route Service Provider code is below

Route::prefix('api/v1')
     ->middleware('api')
     ->namespace($this->namespace)
     ->group(base_path('routes/Login.php'));

Route::prefix('api/v1')
     ->middleware('api')
     ->namespace($this->namespace)
     ->group(base_path('routes/Register.php'));

Is there any way to write both route files under the same group?

In 5.3. we could write like this...

Route::group([
    'middleware'    => 'auth:api',
    'namespace'     => $this->namespace,
    'prefix'        => 'api/v1',
], function ($router) {
    require base_path('routes/API/Driver/Driver.php');
    require base_path('routes/API/Vehicle/Vehicle.php');
});



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kFfzfM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire