creating records. How customize before saving
In my form at the front, there are 2 input fields:
first_name
and last_name
.
But in the User
model (and DB) at the back, there is 1 field: full_name
.
Should I use mutateFormDataBeforeCreate(array $data): array
or beforeCreate(): void
? ( https://filamentphp.com/docs/3.x/panels/resources/creating-records#customizing-data-before-saving )
If it's beforeCreate
, then how can I pick up the submitted form data? (the documentation didnt illustrate that)1 Reply
Well, if you don't know how to archive you goal with
beforeCreate()
and the other one is labelled as "customizing data before saving", why don't you just use it? π