Cachet is now a Laravel 5 app

This commit is contained in:
Joseph Cohen
2015-03-20 18:30:45 -06:00
parent 7cfa158e68
commit b4ac66d727
338 changed files with 4164 additions and 4114 deletions

View File

@@ -0,0 +1,60 @@
<?php
use CachetHQ\Cachet\Models\Component;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
class ComponentTableSeeder extends Seeder
{
/**
* Run the database seeding.
*
* @return void
*/
public function run()
{
Model::unguard();
$defaultComponents = [
[
"name" => "API",
"description" => "Used by third-parties to connect to us",
"status" => 2,
"user_id" => 1,
"order" => 0,
"group_id" => 0,
"link" => "",
], [
"name" => "Documentation",
"description" => "Kindly powered by Readme.io",
"status" => 1,
"user_id" => 1,
"order" => 0,
"group_id" => 0,
"link" => "https://docs.cachethq.io",
], [
"name" => "Website",
"description" => "",
"status" => 1,
"user_id" => 1,
"order" => 0,
"group_id" => 0,
"link" => "https://cachethq.io",
], [
"name" => "Blog",
"description" => "The Cachet HQ blog.",
"status" => 1,
"user_id" => 1,
"order" => 0,
"group_id" => 0,
"link" => "https://blog.cachethq.io",
],
];
Component::truncate();
foreach ($defaultComponents as $component) {
Component::create($component);
}
}
}

View File

@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeding.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call('UsersTableSeeder');
$this->call('SettingsTableSeeder');
$this->call('IncidentTableSeeder');
$this->call('ComponentTableSeeder');
}
}

View File

@@ -0,0 +1,58 @@
<?php
use CachetHQ\Cachet\Models\Incident;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
class IncidentTableSeeder extends Seeder
{
/**
* Run the database seeding.
*
* @return void
*/
public function run()
{
Model::unguard();
$defaultIncidents = [
[
"name" => "Awesome",
"message" => "We totally nailed the fix.",
"status" => 4,
"component_id" => 0,
"user_id" => 1,
"scheduled_at" => null,
],
[
"name" => "Monitoring the fix",
"message" => "We're checking that our fix will first work.",
"status" => 3,
"component_id" => 0,
"user_id" => 1,
"scheduled_at" => null,
],
[
"name" => "Update",
"message" => "We've found the problem, so we're looking at it.",
"status" => 2,
"component_id" => 0,
"user_id" => 1,
"scheduled_at" => null,
],
[
"name" => "Test Incident",
"message" => "Something went wrong, oh noes.",
"component_id" => 0,
"user_id" => 1,
"scheduled_at" => null,
],
];
Incident::truncate();
foreach ($defaultIncidents as $incident) {
Incident::create($incident);
}
}
}

View File

@@ -0,0 +1,59 @@
<?php
use CachetHQ\Cachet\Models\Setting;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
class SettingsTableSeeder extends Seeder
{
/**
* Run the database seeding.
*
* @return void
*/
public function run()
{
Model::unguard();
$defaultSettings = [
[
"name" => "app_name",
"value" => "Cachet Demo",
],
[
"name" => "app_domain",
"value" => "https://demo.cachethq.io",
],
[
"name" => "show_support",
"value" => "1",
],
[
"name" => "app_locale",
"value" => "en",
],
[
"name" => "app_timezone",
"value" => "Europe/London",
],
[
"name" => "app_track",
"value" => "1",
],
[
"name" => "app_incident_days",
"value" => "7",
],
[
"name" => "app_analytics",
"value" => "UA-58442674-3",
],
];
Setting::truncate();
foreach ($defaultSettings as $setting) {
Setting::create($setting);
}
}
}

View File

@@ -0,0 +1,34 @@
<?php
use CachetHQ\Cachet\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
class UsersTableSeeder extends Seeder
{
/**
* Run the database seeding.
*
* @return void
*/
public function run()
{
Model::unguard();
$users = [
[
"username" => "test",
"password" => "test123",
"email" => "test@test.com",
"level" => 1,
"api_key" => "9yMHsdioQosnyVK4iCVR",
],
];
User::truncate();
foreach ($users as $user) {
User::create($user);
}
}
}