JonVonWeston
How to perform action before saving relationships?
Hiya - I've latched into mutateFormDataBeforeSave - I was able to add and remove items from the data array before it was all persisted. I'm assuming you could do whatever you need to do at that point?
6 replies
Relation manager - embed in form?
"@teleport
Livewire v3 will also include a new @teleport Blade directive that will allow you to "teleport" a piece of markup and render it another part of the DOM. This can sometimes help avoid z-index issues with modals and slideouts.
In Filament v2, you are unable to embed the table builder within the form builder. The most useful application for this is putting a relation manager inside a resource form in the admin panel. This is due to a limitation with HTML, as it doesn't allow nested <form> elements.
This new teleport feature will allow us to teleport the nested <form> elements away, and provide you with this feature!"
8 replies
Advice required: Form editing / saving Parent and many children
I'm using category to define the type - reason for this is to allow for hierarchial categories - Trailer -> Flat Bed -> 2 wheel, and the user is able to assign properties relevant to each of those cateogies and when I create the product I traverse that hierachy and create a list of properties that apply to a 2 wheeled flat bed trailer.
18 replies
Advice required: Form editing / saving Parent and many children
The properties are dynamic on a product - so for a vehicle they could have a set of properties vin / engine size etc. but for trailer might be a different set of properties - load capacity / powered brakes etc. and they may want to add a new property later on - colour for example that can be relevant on both cars, trailers and horseboxes say
18 replies
Advice required: Form editing / saving Parent and many children
Don't think so - although the majority of child properties are boolean - such as power steering , abs etc. some are inputs - registration number, or selects - fuel type etc. I also want to spread the properties across multiple tabs - vehicle, interior features, exterior features etc.
18 replies
spatie media library - multiple image fields on a resource
Forms\Components\Tabs\Tab::make('Images')
->schema([
SpatieMediaLibraryFileUpload::make('preview')
->collection('preview'),
SpatieMediaLibraryFileUpload::make('icon')
->collection('icon'),
SpatieMediaLibraryFileUpload::make('images')
->collection('images')
->multiple()
]),
4 replies