Missing required parameter for View route

I have just found out the wonder of Repeaters, and after adding one to a form, the first time I submitted the form I got an error Missing required parameter for [Route: filament.admin.resources.customers.view] [URI: admin/customers/{record}] [Missing parameter: record] I haven't changed anything in terms of routing (that I know of!). In my CustomerResource::getPages() method, I have
'view' => Pages\ViewCustomer::route('/{record}'),
'view' => Pages\ViewCustomer::route('/{record}'),
which is what I had before this broke. I tried to remove the Repeater section, and I still get this error. What is strange though, is that when I complete the form - both with and without the repeater, the customer is created. But if I fill out the repeater, the Repeater element is NOT created.
Solution:
Did ou change something in the CreateCustomer class? Could you try this? This should redirect to the index page after creating a record... just to try it ```php protected function getRedirectUrl(): string...
Jump to solution
4 Replies
Solution
LeandroFerreira
LeandroFerreira8mo ago
Did ou change something in the CreateCustomer class? Could you try this? This should redirect to the index page after creating a record... just to try it
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('index');
}
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('index');
}
sdousley
sdousleyOP8mo ago
Other than adding the new Step and Repeater (within the steps) didn't add anything to CreateCustomer, but removing that, I still had the same error. Adding the getRedirectUrl() method you pasted made it work now (though it didn't save the repeater, but that is likely me not fully completing the required steps yep, adding ->relationship() to the Repeater has sorted that out
sdousley
sdousleyOP8mo ago
why would I (now) have to add that getRedirectUrl() method when it used to work?
LeandroFerreira
LeandroFerreira8mo ago
By default, after saving the form, the user will be redirected to the View page, if it is present. You can remove this method to keep the default behavior This was a test, isn't related with the issue..
Want results from more Discord servers?
Add your server