Marek
Filling data in custom forms on a custom page does not work
I am trying to have two forms on a custom page for a resource. Neither of forms is attached to the model.
I am unable to populate the form with data. It just doesn't do anything. Here's what I've done:
I've checked, when method is executed,
$this->record
is populated, if I do dd($form)
in that method, it seems form has the details.
But when page is rendered, the details are not populated.
What am I doing wrong?13 replies
Route not found for Filament Resource Page
I'm an experienced PHP/Symfony developer, my experience with Laravel and Filament is very limited. I apologise in advance for a trivial question.
I created a new Resource, with two pages:
index
, and issue
. Autodiscovery seems to work fine, when I run the route:list
command from the command line, I see the routes:
When I try to use the route in Filament's Action, I get the following error:
Well, clearly it's defined, as route:list
lists that route... so not sure what is going on here.
I have tried clearing cache, restarting the app, even restarted my PC.
The relevant PHP code that tries to use the route is:
PremiumResource
class:
ListPremiums
extends ListRecords
, while IssuePremium
extends EditRecord
.
Thank you.33 replies
Simple question about nested models with Form
Hello,
This is my first time using Filament, so please be gentle with me. I've tried to find a solution on-line, including asking AI, but I cannot figure out what I am doing wrong.
I got three models: Child, Parent, and Grandparent.
Child belongs to Parent, Parent belongs to Grandparent.
I would like to display, on the Child view page, values from both Parent and Grandparent. In the form builder I have tried to access their values using dot notation, so it looks like this:
Unfortunately, neither
parent.name
nor parent.grandparent.name
values are being populated.
I have overloaded ViewRecord::mount()
to check if record is populated correctly - it is.
I have tried to use ->state(fn (Child $record) => $record->parent->name)
to set the value, but this throws an exception about accessing uninitialised $container
.
Is there a way to build a view page that does not look like a form? I have some resources (or part of resources) I would like to view and never edit.
Any help/pointers will be appreciated.
Kind regards,
Marek8 replies