Best way to add a "view-only" card inside a Form
Heya! I have just started using FilamentPHP (loving it!) and I'd like to create a "details" view-only card inside one of my resource forms.
The card should contain data derived from the current state of the form.
I have tried with both a custom livewire Component and a custom AlpineJs field, but I can't seem to find the way to pass data from the form to my view.
Any pointers?
Adding an example of what I'd like to achieve (the data depends on the element selected on the above Select)
2 Replies
Have you looked at this?
https://filamentphp.com/docs/2.x/forms/advanced#dependant-fields--components
Then you could use the 'view' field to make the card I think
https://filamentphp.com/docs/2.x/forms/fields#view
i would use a View instead of ViewField
inside the view, you can use $evaluate(fn ($get) => $get(‘select name’)) to get the value of the select