group(function () { Route::get('document/form/{element}', 'DocumentAPIController@form'); Route::resource('document', 'DocumentAPIController'); }); // Public routes for document Route::get('documents/', 'DocumentPublicController@index'); Route::get('documents/{slug?}', 'DocumentPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for documents Route::prefix('{guard}/document')->group(function () { Route::get('document/form/{element}', 'DocumentAPIController@form'); Route::apiResource('document', 'DocumentAPIController'); }); // Public routes for documents Route::get('document/Document', 'DocumentPublicController@getDocument'); } ); }