This commit is contained in:
Graham Campbell
2014-12-20 21:20:17 +00:00
parent 26e4361d8a
commit 9d8d89248f
103 changed files with 2478 additions and 2353 deletions
+32 -31
View File
@@ -1,38 +1,39 @@
<?php
class ComponentTableSeeder extends Seeder {
class ComponentTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$defaultComponents = [
[
"name" => "API",
"description" => "Used by third-parties to connect to us",
"status" => 1,
"user_id" => 1
], [
"name" => "Payments",
"description" => "Backed by Stripe",
"status" => 1,
"user_id" => 1
], [
"name" => "Website",
"status" => 1,
"user_id" => 1
]
];
$defaultComponents = [
[
"name" => "API",
"description" => "Used by third-parties to connect to us",
"status" => 1,
"user_id" => 1,
], [
"name" => "Payments",
"description" => "Backed by Stripe",
"status" => 1,
"user_id" => 1
], [
"name" => "Website",
"status" => 1,
"user_id" => 1
],
];
Component::truncate();
Component::truncate();
foreach($defaultComponents as $component) {
Component::create($component);
}
}
foreach ($defaultComponents as $component) {
Component::create($component);
}
}
}
+14 -14
View File
@@ -1,19 +1,19 @@
<?php
class DatabaseSeeder extends Seeder {
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call('SettingsTableSeeder');
$this->call('IncidentTableSeeder');
$this->call('ComponentTableSeeder');
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call('SettingsTableSeeder');
$this->call('IncidentTableSeeder');
$this->call('ComponentTableSeeder');
}
}
+44 -43
View File
@@ -1,50 +1,51 @@
<?php
class IncidentTableSeeder extends Seeder {
class IncidentTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$defaultIncidents = [
[
"name" => "Test Incident",
"message" => "Something went wrong, oh noes.",
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Update",
"message" => "We've found the problem, so we're looking at it.",
"status" => 2,
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Monitoring the fix",
"message" => "We're checking that our fix will first work.",
"status" => 3,
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Awesome",
"message" => "We totally nailed the fix.",
"status" => 4,
"component_id" => 2,
"user_id" => 1,
]
];
$defaultIncidents = [
[
"name" => "Test Incident",
"message" => "Something went wrong, oh noes.",
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Update",
"message" => "We've found the problem, so we're looking at it.",
"status" => 2,
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Monitoring the fix",
"message" => "We're checking that our fix will first work.",
"status" => 3,
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Awesome",
"message" => "We totally nailed the fix.",
"status" => 4,
"component_id" => 2,
"user_id" => 1,
],
];
Incident::truncate();
Incident::truncate();
foreach($defaultIncidents as $incident) {
Incident::create($incident);
}
}
foreach ($defaultIncidents as $incident) {
Incident::create($incident);
}
}
}
+21 -20
View File
@@ -1,27 +1,28 @@
<?php
class SettingsTableSeeder extends Seeder {
class SettingsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$defaultSettings = [
[
"name" => "site_name",
"value" => "Test"
]
];
$defaultSettings = [
[
"name" => "site_name",
"value" => "Test",
],
];
Setting::truncate();
Setting::truncate();
foreach($defaultSettings as $setting) {
Setting::create($setting);
}
}
foreach ($defaultSettings as $setting) {
Setting::create($setting);
}
}
}