group(function () { Route::resource('course', 'CourseResourceController'); }); // Public routes for course Route::get('courses/', 'CoursePublicController@index'); Route::get('courses/{slug?}', 'CoursePublicController@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', 'CourseResourceController'); }); // Public routes for pages Route::get('courses/', 'CoursePublicController@index'); Route::get('courses/{slug?}', 'CoursePublicController@show'); } ); } // web routes for subject Route::prefix('{guard}/course')->group(function () { Route::resource('subject', 'SubjectResourceController'); }); // Public routes for subject Route::get('courses/', 'SubjectPublicController@index'); Route::get('courses/{slug?}', 'SubjectPublicController@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', 'SubjectResourceController'); }); // Public routes for pages Route::get('courses/', 'SubjectPublicController@index'); Route::get('courses/{slug?}', 'SubjectPublicController@show'); } ); } // web routes for topic Route::prefix('{guard}/course')->group(function () { Route::resource('topic', 'TopicResourceController'); }); // Public routes for topic Route::get('courses/', 'TopicPublicController@index'); Route::get('courses/{slug?}', 'TopicPublicController@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', 'TopicResourceController'); }); // Public routes for pages Route::get('courses/', 'TopicPublicController@index'); Route::get('courses/{slug?}', 'TopicPublicController@show'); } ); }