In MySql I have two tables: staff and certifications. There is a one-to-many relationship where staff.pk = certifications.fk.
For each staff member, I need to insert their multiple certifications.name values into a JSON column in the staff table.
I also need to be able to read this as an array cast in a Laravel - does that mean it needs to be a JSON array, rather than a JSON object?
UPDATE:
I need to do this as a batch process, since I have many thousands of records to process. That's why I am concencentrating on the raw SQL. Instantiating Eloquent models would not work from a performance perspective.
staffandcertificationsthen why do you want to store certifications in staff table ?