F
Filament14mo ago
harps

404 create page

I've just added a create route to a resource and I'm getting a 404, If iI remove the create key from the array then the modal works fine. I have other resources that work ok by adding and removing the create key it toggles modal on and off but not this specific resource. Have I missed something for this resource?
public static function getPages(): array
{
return [
'index' => Pages\ListProjects::route('/'),
'view' => Pages\ViewProject::route('/{record}'),
'create' => Pages\CreateProject::route('/create'),
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListProjects::route('/'),
'view' => Pages\ViewProject::route('/{record}'),
'create' => Pages\CreateProject::route('/create'),
];
}
Uaing xdebug and puasing exceptions I get the following errors. "File does not exist at path /app/storage/framework/cache/data/47/e0/47e0354a704ca2aab47ed06ea898849d8a435dfe." "No query results for model [App\Models\Project] create" I have other models / resources that are working, I can't work out why this one is different.
Solution:
Order matters. Your create route should be defined before view otherwise it's looking for a record with ID create
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch14mo ago
Order matters. Your create route should be defined before view otherwise it's looking for a record with ID create
harps
harpsOP14mo ago
Thanks 🤦‍♂️
Want results from more Discord servers?
Add your server