Middleware: Group

Route::group(['prefix' => 'api'], function() {
    Route::group(['prefix' => 'v1'], function() {
        Route::get('create', 'GarciController@create');
        Route::get('index', 'GarciController@index');
    });
    Route::group(['prefix' => 'v2'], function() {
        Route::get('create', 'YoutubeController@create');
        Route::get('index', 'YoutubeController@index');
    });
});

Ejemplo:
http://localhost/edc_laravel/public/api/v1/create
http://localhost/edc_laravel/public/api/v2/index

No hay comentarios:

Publicar un comentario