group(function () { Route::get('article/form/{element}', 'ArticleAPIController@form'); Route::resource('article', 'ArticleAPIController'); }); // Public routes for article Route::get('articles/', 'ArticlePublicController@index'); Route::get('articles/{slug?}', 'ArticlePublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for articles Route::prefix('{guard}/article')->group(function () { Route::get('article/form/{element}', 'ArticleAPIController@form'); Route::apiResource('article', 'ArticleAPIController'); }); // Public routes for articles Route::get('article/Article', 'ArticlePublicController@getArticle'); } ); } // API routes for category Route::prefix('{guard}/article')->group(function () { Route::get('category/form/{element}', 'CategoryAPIController@form'); Route::resource('category', 'CategoryAPIController'); }); // Public routes for category Route::get('articles/', 'CategoryPublicController@index'); Route::get('articles/{slug?}', 'CategoryPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for articles Route::prefix('{guard}/article')->group(function () { Route::get('category/form/{element}', 'CategoryAPIController@form'); Route::apiResource('category', 'CategoryAPIController'); }); // Public routes for articles Route::get('article/Category', 'CategoryPublicController@getCategory'); } ); }