andries
andries
FFilament
Created by andries on 5/16/2024 in #❓┊help
Multi field FieldComponent
I am trying to find out if it is possible to create a custom field / livewire component that actually controls several database fields in a filament form. For example a google maps integration where you can define the latitude and longitude database columns. Something like this:
GoogleMapsField::make('')
->setStatePathLatitude('latitude')
->setStatePathLongitude('longitude)
GoogleMapsField::make('')
->setStatePathLatitude('latitude')
->setStatePathLongitude('longitude)
All implementations (including the existing google maps plugin) use tricks to overcome this (like getter and setter attributes on the model, or have traits on the editRecord/createRecord page). But I was wondering if it is possible to create a component that interacts with a form and can set several "statePaths". If I read the document of a field, there it is clearly stated that a field is bound to one public property, so my guess is that it is not possible, but just checking. Thanks in advance kind regards Andries
20 replies
FFilament
Created by andries on 8/10/2023 in #❓┊help
Summariser showing related data in group
We are trying to show a table of order lines, and use the group feature to group them by order_id. Ideally we would be able to show data from the related order, and we would be able to specify a custom view / component So we would have: =================== Order header Order 1 : status Order 1 : date ---------------------- Orderline 1: quantity Orderline 1: amount ---------------------- Orderline 2: quantity Orderline 2: amount =================== Order header Order 2 : status Order 2 : date ---------------------- Orderline 1: quantity Orderline 1: amount ---------------------- Orderline 2: quantity Orderline 2: amount Can this be achieved?
13 replies