How to make such a multi input field?
Hello everybody.
I have a table:
sites:
id
user_id
domain
mirrors (json type)
I want to add mirrors like in the picture.
Maybe it's better to make a separate table for mirrors instead of using the json type? Which is better?
sites:
id
user_id
domain
mirrors (json type)
OR
sites:
id
user_id
domain
site_mirrors:
site_id
domain
5 Replies
Which is better?Why don't you try both and check for yourself..
How to make such a multi input field?https://filamentphp.com/docs/3.x/forms/fields/repeater Based on Image, this is perfect imo https://filamentphp.com/docs/3.x/forms/fields/repeater#simple-repeaters-with-one-field
Thank you!
In general practice, which option is preferable? There are generally accepted patterns on this topic.
I didn't know that.. for me everything is personal preferences π
"We recommend that you store repeater data with a JSON column in your database. Additionally, if you're using Eloquent, make sure that column has an array cast."
imo this is a recommendation for using a repeater, not about which is better