Added ComponentTableSeeder

This commit is contained in:
James Brooks
2014-11-19 12:05:09 +00:00
parent 916110c32c
commit 589a47cabc
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
class ComponentTableSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$defaultComponents = [
[
"name" => "API",
"description" => "Used by third-parties to connect to us"
],
[
"name" => "Payments",
"description" => "Backed by Stripe"
],
[
"name" => "Website"
]
];
Component::truncate();
foreach($defaultComponents as $setting) {
Component::create($setting);
}
}
}

View File

@@ -13,6 +13,7 @@ class DatabaseSeeder extends Seeder {
$this->call('SettingsTableSeeder');
$this->call('IncidentTableSeeder');
$this->call('ComponentTableSeeder');
}
}