UserResource fails to load when RouteKey is defined

I have Spatie/Sluggable set up on my User model, so my users' bio pages can be displayed on the public site. When I set the RouteKey to use this slug, I get the following error from the UserResource
Missing required parameter for [Route: filament.admin.resources.users.edit] [URI: admin/users/{record}/edit] [Missing parameter: record]. at /home/forge/nftnewstoday.com/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php:35)
Missing required parameter for [Route: filament.admin.resources.users.edit] [URI: admin/users/{record}/edit] [Missing parameter: record]. at /home/forge/nftnewstoday.com/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php:35)
2 Replies
toeknee
toeknee5mo ago
However the url is being fetched the record / record id is missing Not familiar with that plugin tbh...
Dennis Koch
Dennis Koch5mo ago
Maybe it helps to set protected static ?string $recordRouteKeyName = 'slug' to the resource?

Did you find this page helpful?