How do you handle models with custom route keys?
I have articles, their route key is a slug column - I can't see anywhere in the filament docs how to handle this. I'm fine if filament wants to fetch models based on their id, rather than the slug - but it trips over itself:
How is this meant to be handled?
3 Replies
Actually, all good - decided to disable the routeKey and instead just handle it manually, as I was going to do that for route model binding anyway.
Right: Filament depends on you configuring your app to use Laravel conventions for route-model-binding.
While there are ways to modify various queries at various points, it gets super complicated to do that if you're not using Laravel's standard approaches and then want Filament to do things with nested relationships or filters or sorts or searches.
Yeah I've found a few cases where laravel conventions get in my way. It's rare, however.