F
Filamentsdousley

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...
Solution
L
LeandroFerreira13d 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');
}
S
sdousley13d 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
S
sdousley13d ago
why would I (now) have to add that getRedirectUrl() method when it used to work?
L
LeandroFerreira13d 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
More Posts
Downloadable() and Openable() gives me 404 errorhello! I am currently creating our system and the downloadable() and openable() syntax in my filamenhow to add external url in navigationi want to add external url in my navigation sidebar. but i find a way for a specific resource. whatcustom themeHas anyone used Multi-Tenancy with diferent DB Sqlite???Livewire View Not foundI have a brand new install of Laravel 11, Filament 3 and Livewire 3. I have been configuring the adBumped from 3 to 3.2 and getting Leage\Csv\Writer not found```/vendor/filament/actions/src/Exports/Jobs/PrepareCsvExport.php:53 Leage\Csv\Writer not found ``` Using TailwindHi I have a project where I'm using Tailwind. I have a related resouce, which I want to highlught Deferring loadingWhat does it actually do for tables?Column not found with table filter and joinsHello everyone, I am working on my first project with filament and I have hit a brick wall. I'm trTrying to find a way to show the infolist in the EditResource pageis it possible? so far i've just managed to make it appear in the view page, but id like it to appeahow to update another model instead of updating current resource?hello i want to insert data into another model first when user edit a form. what should i do?Laravel-Filament Qr generateHello, I hope you have a good day. I want to make a QR converter based on Laravel-filament. I want aHow to download Export instead of storing on server?I have created an export header action on my table like this: ```php ->headerActions([ ExportActioWizard form submitSo im using wizard steps and in my form i have 3 steps but the "create" , "create and create anotherWidget table custom queryHi all, i've a widget that aims to show the latest casting like this: ```php class LatestCastings Policy not applying on custom actionI have a custom filament class that extends filament table action. Its purpose is to update the recoIncorrect orderingHello everybody. Guys, why is this ordering always wrong? The 1040 should come at the end and not at