group(function () { Route::get('course/form/{element}', 'CourseAPIController@form'); Route::resource('course', 'CourseAPIController'); }); // 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 courses Route::prefix('{guard}/course')->group(function () { Route::get('course/form/{element}', 'CourseAPIController@form'); Route::apiResource('course', 'CourseAPIController'); }); // Public routes for courses Route::get('course/Course', 'CoursePublicController@getCourse'); } ); } // API routes for subject Route::prefix('{guard}/course')->group(function () { Route::get('subject/form/{element}', 'SubjectAPIController@form'); Route::resource('subject', 'SubjectAPIController'); }); // 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 courses Route::prefix('{guard}/course')->group(function () { Route::get('subject/form/{element}', 'SubjectAPIController@form'); Route::apiResource('subject', 'SubjectAPIController'); }); // Public routes for courses Route::get('course/Subject', 'SubjectPublicController@getSubject'); } ); } // API routes for topic Route::prefix('{guard}/course')->group(function () { Route::get('topic/form/{element}', 'TopicAPIController@form'); Route::resource('topic', 'TopicAPIController'); }); // 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 courses Route::prefix('{guard}/course')->group(function () { Route::get('topic/form/{element}', 'TopicAPIController@form'); Route::apiResource('topic', 'TopicAPIController'); }); // Public routes for courses Route::get('course/Topic', 'TopicPublicController@getTopic'); } ); }