phpvms/database/seeds/DatabaseSeeder.php
2017-07-13 18:09:08 -05:00

25 lines
473 B
PHP
Executable File

<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$env = App::environment();
$path = database_path('seeds/'.$env.'.yml');
if(!file_exists($path)) {
$path = database_path('seeds/prod.yml');
}
$svc = app('App\Services\DatabaseService');
$svc->seed_from_yaml_file($path);
}
}