Closed StefanoTesla closed 11 months ago
//a lot of use use use
class ProductsResource extends Resource
{
use Translatable;
//some variable
protected static ?string $recordRouteKeyName = 'id';
//some models
public static function getPages(): array
{
return [
'index' => Pages\ListCategories::route('/'),
'create' => Pages\CreateCategories::route('/create'),
'edit' => Pages\EditCategories::route('/{record:id}/edit'),
];
}
If I my resource I do this, work!
No reproduction repository. Let me know when you have one and I'll reopen it.
Package
filament/filament
Package Version
latest
Laravel Version
latest
Livewire Version
No response
PHP Version
8.2
Problem description
I'm using mcamara/laravel-localization and spatie/laravel-translatable and filamentphp/spatie-laravel-translatable-plugin
To make the models viewing and get the others languages correct slug I need to set the model getRouteKeyName as this:
but with this trick filament fail:
[Missing required parameter for [Route: filament.admin.resources.categorie.edit] [URI: admin/categorie/{record}/edit] [Missing parameter: record].](http://127.0.0.1:8000/admin/categorie#top)
If I change the
getRouteKeyName
as this:Filament work, but the entry site not.
I tried to add
protected static ?string $recordRouteKeyName = 'id';
(I don't care about slug in filament) but nothing change.Expected behavior
Filament don't goes in error
Steps to reproduce
Make the same getRouteKeyName like me and tadan
Reproduction repository
https://github.com/icantdoit/
Relevant log output
No response