2014-11-19 12:05:09 +00:00
|
|
|
<?php
|
|
|
|
|
2015-01-01 15:43:05 +00:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
|
2014-12-20 21:20:17 +00:00
|
|
|
class ComponentTableSeeder extends Seeder
|
|
|
|
{
|
|
|
|
/**
|
2015-01-01 16:00:19 +00:00
|
|
|
* Run the database seeding.
|
2014-12-20 21:20:17 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function run()
|
|
|
|
{
|
2015-01-01 15:43:05 +00:00
|
|
|
Model::unguard();
|
2014-11-19 12:05:09 +00:00
|
|
|
|
2014-12-20 21:20:17 +00:00
|
|
|
$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
|
|
|
|
],
|
|
|
|
];
|
2014-11-19 12:05:09 +00:00
|
|
|
|
2014-12-20 21:20:17 +00:00
|
|
|
Component::truncate();
|
2014-11-19 12:05:09 +00:00
|
|
|
|
2014-12-20 21:20:17 +00:00
|
|
|
foreach ($defaultComponents as $component) {
|
|
|
|
Component::create($component);
|
|
|
|
}
|
|
|
|
}
|
2014-11-19 12:05:09 +00:00
|
|
|
}
|