I am wondering what the best way to accomplish this would be. I need to store an array such as:
['hello', 'world', 'love']
Inside one column in a table. I do not want to create a new table where each value in the array becomes a separate row. Is there a better way? I guess my biggest concern is performance.
So when creating the migration for this column, ideally I would insert an array with 3 default/nullable values. Then I can set actual values for the array when needed in my application.
Simple scenario: I have a table called desk and I want to store 3 items that are on top of the desk such as ['pencil', 'ruler', 'stapler'], but I do not want to create a separate table desk_items to have a row for each item. Hope this makes sense.
Using Laravel and MYSQL
Thank you.
hasManyrelationship is the best way to go.