Passing data to custom pages
Hi everyone!
I need to build something like a custom resource, but using pages. It's a little more complicated, but imagine a model User that I display in a table first, with clickable entries that lead me to the corresponding EditPage and the prefilled form. So basically regular resource behavior. I managed to build the table and have the rows clickable with
So my questions are:
This doesn't work though. I think I need to update the route so it accepts parameters,
I'm still kinda new to Laravel and Filament and I feel like I'm missing some basic knowledge, that I struggle to find in the docs. Where can I find these info in docs? Are there any tutorials to this specific topic?
I need to build something like a custom resource, but using pages. It's a little more complicated, but imagine a model User that I display in a table first, with clickable entries that lead me to the corresponding EditPage and the prefilled form. So basically regular resource behavior. I managed to build the table and have the rows clickable with
->recordUrl(fn(User $record) => route('filament.admin.pages.user-edit', ['record' => $record->id])) but I struggle with the form.So my questions are:
- Is that the correct way of making the row clickable and passing the record?
- How do I set up the Edit Page correctly? Meaning getting the passed $record data and prefilling the form?
This doesn't work though. I think I need to update the route so it accepts parameters,
php artisan route:list tells me, that unlike the regular resources, the route for my Edit Page doesn't accept a parameter. But I also don't know how to get this parameter inside the page.I'm still kinda new to Laravel and Filament and I feel like I'm missing some basic knowledge, that I struggle to find in the docs. Where can I find these info in docs? Are there any tutorials to this specific topic?