jeroenzwart / laravel-csv-seeder

Seed your database with Laravel using CSV files
Other
92 stars 30 forks source link

How do I specify a different database connection? #14

Closed bralat closed 4 years ago

bralat commented 4 years ago

I am writing tests for my application and I need to seed data into the default database and one other one. Seeding into the default database is simple enough, but how do I specify a different database connection for the other seeders ?

bralat commented 4 years ago

I was able to solve this, kinda

I created a variable for connection and modified the package to use that variable for every database query.

I have submitted a pull request here https://github.com/jeroenzwart/laravel-csv-seeder/pull/15

bralat commented 4 years ago

I am closing this since the pull request that allows users to specify a database connection has been merged.

You can find the pull request here