samedi 27 août 2016

Laravel 5 - How to seed table automatically after deploying an app?

I have a certain data that must be in table in order for my app to work, otherwise i get an error message.

For example if YOU or anyone else pulled my app from github and if you run php artisan migrate and then try to test the app you would get an error: data doesn't exist or something like that. and it's because there is no data in table.

So ideal solution would be after running:

 php artisan migrate

that you also get this needed data in that table.

This should be done somehow with the seeder but i don't know how. Can anyone help and give me an example?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire