phpvms/database/seeds/DatabaseSeeder.php

25 lines
435 B
PHP
Raw Normal View History

2017-06-09 02:28:26 +08:00
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$env = App::environment();
2017-06-20 00:50:25 +08:00
$path = database_path('seeds/'.$env.'.yml');
if(!file_exists($path)) {
return;
2017-06-20 00:50:25 +08:00
}
$svc = app('App\Services\DatabaseService');
$svc->seed_from_yaml($path);
}
2017-06-09 02:28:26 +08:00
}