group(function () { Route::resource('note', 'NoteResourceController'); }); 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', 'NoteResourceController'); }); // Public routes for pages Route::get('notes/', 'NotePublicController@index'); Route::get('notes/{slug?}', 'NotePublicController@show'); } ); }