group(function () { Route::get('documents/form/{element}', 'DocumentsAPIController@form'); Route::resource('documents', 'DocumentsAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for documents Route::prefix('{guard}/document')->group(function () { Route::get('documents/form/{element}', 'DocumentsAPIController@form'); Route::apiResource('documents', 'DocumentsAPIController'); }); // Public routes for documents Route::get('document/Documents', 'DocumentsPublicController@getDocuments'); } ); }