group(function () { Route::resource('course', 'CourseResourceController'); }); // Guard routes for topic Route::prefix('{guard}/course')->group(function () { Route::resource('topic', 'TopicResourceController'); }); // Guard routes for subject Route::prefix('{guard}/course')->group(function () { Route::resource('subject', 'SubjectResourceController'); }); // Public routes for course Route::get('courses/', 'CoursePublicController@index'); Route::get('course/{slug?}', 'CoursePublicController@show');