Hello,
How is supposed to be managed the index method in shallow nesting?
Route::resource('videos.comments', CommentController::class)->shallow();
Route::resource('photos.comments', CommentController::class)->shallow();
class CommentController extends Controller
{
public function index()
{
// How to handle here the binded model? (Video or Photo)
}
}
And how is it supposed to make a different representation depending on the model?
class CommentController extends Controller
{
public function index()
{
// If the binded model is Video, the builder columns, filters and relationships are different from Photo model
}
}
I'm totally missed in this shallow approach 🥲