group(function () { Route::resource('blog', 'BlogResourceController'); }); // Public routes for blog Route::get('blogs/', 'BlogPublicController@index'); Route::get('blogs/{slug?}', 'BlogPublicController@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', 'BlogResourceController'); }); // Public routes for pages Route::get('blogs/', 'BlogPublicController@index'); Route::get('blogs/{slug?}', 'BlogPublicController@show'); } ); } // web routes for category Route::prefix('{guard}/blog')->group(function () { Route::resource('category', 'CategoryResourceController'); }); // Public routes for category Route::get('blogs/', 'CategoryPublicController@index'); Route::get('blogs/{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('blogs/', 'CategoryPublicController@index'); Route::get('blogs/{slug?}', 'CategoryPublicController@show'); } ); } // web routes for comment Route::prefix('{guard}/blog')->group(function () { Route::resource('comment', 'CommentResourceController'); }); // Public routes for comment Route::get('blogs/', 'CommentPublicController@index'); Route::get('blogs/{slug?}', 'CommentPublicController@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', 'CommentResourceController'); }); // Public routes for pages Route::get('blogs/', 'CommentPublicController@index'); Route::get('blogs/{slug?}', 'CommentPublicController@show'); } ); } // web routes for tag Route::prefix('{guard}/blog')->group(function () { Route::resource('tag', 'TagResourceController'); }); // Public routes for tag Route::get('blogs/', 'TagPublicController@index'); Route::get('blogs/{slug?}', 'TagPublicController@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', 'TagResourceController'); }); // Public routes for pages Route::get('blogs/', 'TagPublicController@index'); Route::get('blogs/{slug?}', 'TagPublicController@show'); } ); }