-
My seeding file looks like this: I have tried different methods of forming an array:
But when filling into the database, everything looks like this:
Field type in the JSON table. How to correctly form a seed file so that all language versions are added to the database correctly, namely like this?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello. I do it this way: https://github.com/anibalealvarezs/projectbuilder-package/blob/master/src/Database/Seeders/PbLanguagesSeeder.php I use manual JSON encoding because this trait works just for models, and I'm using If you want to use models, you'll have to create the instance (one for each record to be stored) and use any of the available methods por persisting the data, like save |
Beta Was this translation helpful? Give feedback.
-
Thanks. That's how it works! |
Beta Was this translation helpful? Give feedback.
Thanks. That's how it works!
https://github.com/SequelONE/laravel-auth-backpack/blob/main/database/seeders/MenuItemsTableSeeder.php