I figured it out...
Let’s say your source database is MySQL and you have a client table with client_id and client_name columns. On your Laravel project you have a clients table with id, client_name, created_at, and updated_at columns. Add a new connection to your /app/config/database.php. If you have multiple MySQL databases, it’s okay, just append 2… so you have a mysql and mysql2 connection. So your mysql array connection holds your Laravel database and mysql2 holds your database connection information where you’ll be getting data from. Next edit the /app/database/seeds/DatabaseSeeder.php file. Here’s what I have.
here's the seed code
http://laravel.io/bin/PV6k (version 1)
http://laravel.io/bin/M1lQ (version 2, supports multiple tables)... i meant to use $result[]
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community