bfinlay / laravel-excel-seeder

Seed your database with Laravel using Excel and CSV files
Other
38 stars 8 forks source link

How to add Connection if I using this package ? #11

Closed mzcoder-hub closed 2 years ago

mzcoder-hub commented 2 years ago

hi, I'm confusing how do I run the seeder in the specific connection ?

Schema::connection('public')->

its look like that ? in this case im using multi databases

bfinlay commented 2 years ago

I haven't done this exact scenario before. I do use it to seed multiple databases, so I know that it can work, but I use another package for a specific use case that manages the connection so that doesn't make for a good recipe for you.

This answer looks like it probably has what you need: https://stackoverflow.com/questions/26654846/use-one-laravel-migrations-table-per-database

I think the key items are:

If you want to use the default seeder class for one of them, you would omit the --class=. Similar with migrations.

Try it out and update this issue with the results.

mzcoder-hub commented 2 years ago

ok thanks for the answer maybe you need to make its for the good use haha,