I really don't understand what you need. Can you explain and give us an example ?
Nova BelongsTo group
Is this possible to group the dropdown values in the BelongsTo relation?
@vincent15000 Thanks for your reply. Of course, look
I have the Product model that belongsTo Category model. But only a subcategory can be attached to a product. Therefore, when creating a product, i need to show only subcategories grouped by category. understood what I mean?
Models
Product: id, ..., ..., categoty_id
Category: id, ..., parent_id
@anton_shever To be sure ... in your dropdown, you want something like this ?
My first category
- subcategory 1
- subcategory 2
My second category
- subcategory 3
- subcategory 4
@vincent15000 yes, exactly. but this should be implemented with BelongsTo, in order to keep relation links on index and other pages
@anton_shever I think that it's not possible natively. I don't know if it exists any plugin to add this functionality.
@vincent15000 https://nova.laravel.com/docs/4.0/resources/fields.html#select-field. There's an option for providing groups.
@david thanks, but this should be implemented with BelongsTo, in order to keep relation links on index and other pages
Please or to participate in this conversation.