Refactoring routes & controllers on the nested resource in Laravel

A nested resource is a resource with another sub-resource (eg: one-to-many relationship). For instance, a podcast may have multiple episodes. The nested resource of podcast and episodes can be defined as below in Laravel: use App\Http\Controllers\PodcastEpisodesController; Route::resource('podcast.episodes', PodcastEpisodesController::class); The URIs defined in route will be like this: /podcast/{podcast}/episodes/{episode} A similar example in official Laravel 8.x… Continue reading Refactoring routes & controllers on the nested resource in Laravel