Added ComponentTableSeeder
This commit is contained in:
34
app/database/seeds/ComponentTableSeeder.php
Normal file
34
app/database/seeds/ComponentTableSeeder.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ class DatabaseSeeder extends Seeder {
|
|||||||
|
|
||||||
$this->call('SettingsTableSeeder');
|
$this->call('SettingsTableSeeder');
|
||||||
$this->call('IncidentTableSeeder');
|
$this->call('IncidentTableSeeder');
|
||||||
|
$this->call('ComponentTableSeeder');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user