Reorganized folders to try to clean up the root folder a bit

This commit is contained in:
Nabeel Shahzad
2017-12-14 10:38:10 -06:00
parent 40aab22901
commit aa57ab515f
708 changed files with 101315 additions and 89 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Map these other environments to a specific seed file
* @var array
*/
public static $seed_mapper = [
'local' => 'dev',
'qa' => 'dev',
'staging' => 'dev',
];
/**
* Run the database seeds.
*/
public function run()
{
$env = App::environment();
if(array_key_exists($env, self::$seed_mapper)) {
$env = self::$seed_mapper[$env];
}
$path = database_path('seeds/'.$env.'.yml');
print("Seeding seeds/$env.yml\n");
if(!file_exists($path)) {
$path = database_path('seeds/prod.yml');
}
$svc = app('App\Services\DatabaseService');
$svc->seed_from_yaml_file($path);
}
}