Setting two keys from one select field and filling constant data
I have a question regarding forms and filling data.
I have the following form definition, i put in comments what im trying to achieve
Solution:Jump to solution
After asking in #saade-adjacency-list I found a solution
```php
Hidden::make('label'),
Select::make('part_id')
->label('Part')...
7 Replies
This is the full form function on the resource page
having a way to mutate form data before save on the adjecencylist form would also work but i wasnt able to find one
So can I clarify what you are wanting here? is it you want system_id added on save?
I am wondering if what im doing is the correct way to do it and also the other comment i made.
im not the best at writing :p
if there is a way to mutate the data specifically on the form in the adjacency list that would work as well but im not sure how to do that
For performance.
Otherwise it's ok.. usually we would use relationships for parts as a possibility too. Look at it like a repeater
What i meant is i want this label to be the name of the part automatically instead of having a
TextInput::make('label')
So Select::make('part_id')
should fill both the label
and part_id
fields.
Normally you'd do that in a mutate data function before saving but i couldnt find any on the adjaceny list package
Is it something that filament handles or should i ask in the plugin channel?
Solution
After asking in #saade-adjacency-list I found a solution