What is the correct way to automatically pass in a form value (on the backend)?
I'm using this, which doesn't feel secure:
Should I be setting something at the model level?
I did search the docs, but wasn't quite sure where to look to find this.
3 Replies
I guess it depends what you're doing with the value... what is it used for?
If it's for saving the ID on the current record, a model observer is definitely better
Filament
Creating records - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
@pboivin Thanks! I'll look into model observers.
@Dennis Koch - Thanks a lot - that worked perfectly!
Final code (much securer, and does away with the hidden field!):
That's a super useful function actually.