group(function () { Route::resource('documents', 'DocumentsResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'DocumentsResourceController'); }); // Public routes for pages Route::get('documents/', 'DocumentsPublicController@index'); Route::get('documents/{slug?}', 'DocumentsPublicController@show'); } ); }