I have two models: Type and Category. I want to make a route that must contain one slug of each.
That's my route:
Route::get('/route-{type:slug}-{category:slug}', 'Controller@typeAndCategory');
And in my controller:
public function typeAndCategory(Type $bikeType, Category $category) {}
According to Laravel's doc:
When using a custom keyed implicit binding as a NESTED route parameter, Laravel will automatically scope the query to retrieve the nested model by its parent using conventions to guess the relationship name on the parent.
But in my case, those two models haven't relation.
The question is: how can I tell this to Laravel?