Open newtonjob opened 1 year ago
https://github.com/justinkekeocha/udemy/blob/fdc6555aeeb4da81cfde8a64064899905aeb411f/routes/web.php#L54
Resource routes typically offer better flexibility for model resources. In addition, it can be a good way to keep your routes looking simple and clean;
For example, instead of;
Route::prefix('/topic/{topic}')->controller(TopicController::class)->name('topics.')->group(function () { Route::get('/', 'show')->name('show'); }); Route::prefix('/course/{course}')->controller(CourseController::class)->name('courses.')->group(function () { Route::get('/', 'show')->name('show'); });
You might do something like this;
Route::resource('topic', TopicController::class)->only('show'); Route::resource('course', CourseController::class)->only('show');
Correction taken. I will apply this in the new web app I am building, using the API resource route. Thanks.
https://github.com/justinkekeocha/udemy/blob/fdc6555aeeb4da81cfde8a64064899905aeb411f/routes/web.php#L54
Resource routes typically offer better flexibility for model resources. In addition, it can be a good way to keep your routes looking simple and clean;
For example, instead of;
You might do something like this;