Skip to content

Instantly share code, notes, and snippets.

@alnutile
Created December 9, 2014 14:05
Show Gist options
  • Save alnutile/8026859b77f95d408d60 to your computer and use it in GitHub Desktop.
Save alnutile/8026859b77f95d408d60 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
if(App::environment() != 'testing') {
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
}
$this->call('AppTableSeeder');
$this->call('ParentRequestExample');
$this->call('ProductionSeeder');
if(App::environment() != 'testing') {
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment