I created two folders in my seeder folder:
/seeds
/local
/production
DatabaseSeeder.php
Then, defined the following inside DatabaseSeeder.php
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
// Load production seeder
if (App::Environment() === 'production')
{
$this->call('production/UsersTableSeeder');
}
// Load local seeder
if (App::Environment() === 'local')
{
$this->call('local/UsersTableSeeder');
}
}
}
Now I know I can't do call('local/UsersTablderSeeder')
, and that is my question. How can I call()
the seeder files from their respective folders?
Edit
To be clear, when I run the code as it is shown above, I get the following error
[ReflectionException]
Class local/UsersTableSeeder does not exist