group(function () { Route::resource('article', 'ArticleResourceController'); }); // 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 pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'ArticleResourceController'); }); // Public routes for pages Route::get('articles/', 'ArticlePublicController@index'); Route::get('articles/{slug?}', 'ArticlePublicController@show'); } ); } // web routes for category Route::prefix('{guard}/article')->group(function () { Route::resource('category', 'CategoryResourceController'); }); // 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 pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'CategoryResourceController'); }); // Public routes for pages Route::get('articles/', 'CategoryPublicController@index'); Route::get('articles/{slug?}', 'CategoryPublicController@show'); } ); }