Save only de subcategory and show category and subcategory in the Form

I created a form that have name (TextField), category (Select) and subcategory (Select). I Used afterStateUpdated to fill the subcategory and works fine when I create a new register, but I save only de subcategory id in the database. How can I select the category based on the belongsTo from subcategory when I open an Edit Form? I dont want to save category_id in the register.
2 Replies
IndomieRendang
IndomieRendang17mo ago
Just grab the parent using eloquent
dguedert
dguedertOP17mo ago
I'm using belongsTo eloquent. But how can I use in Select::make ?
Want results from more Discord servers?
Add your server