Passed
Push — master ( c430e0...09e8fc )
by Davide
02:42 queued 11s
created

EventCategoriesTableSeeder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 18
dl 0
loc 28
rs 10
c 1
b 0
f 1
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 21 2
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
/*
6
|--------------------------------------------------------------------------
7
| Seeders
8
|--------------------------------------------------------------------------
9
|
10
| Seders are used to generate datas to populate the database of the test environment.
11
|
12
*/
13
14
class EventCategoriesTableSeeder extends Seeder
15
{
16
    /**
17
     * Run the database seeds.
18
     *
19
     * @return void
20
     */
21
    public function run()
22
    {
23
        $event_categories = [
24
           ['id' => '1', 'name' => 'Regular Jam', 'slug' => ''],
25
           ['id' => '2', 'name' => 'Class', 'slug' => ''],
26
           ['id' => '3', 'name' => 'Workshop', 'slug' => ''],
27
           ['id' => '6', 'name' => 'Festival', 'slug' => ''],
28
           ['id' => '10', 'name' => 'Special Jam', 'slug' => ''],
29
           ['id' => '11', 'name' => 'Underscore', 'slug' => ''],
30
           ['id' => '12', 'name' => 'Teachers Meeting', 'slug' => ''],
31
           ['id' => '13', 'name' => 'Performance', 'slug' => ''],
32
           ['id' => '14', 'name' => 'Lecture / Conference / Film', 'slug' => ''],
33
           ['id' => '15', 'name' => 'Lab', 'slug' => ''],
34
           ['id' => '16', 'name' => 'Camp / Journey', 'slug' => ''],
35
           ['id' => '17', 'name' => 'Other event', 'slug' => ''],
36
       ];
37
38
        foreach ($event_categories as $key => $event_category) {
39
            DB::table('event_categories')->insert([
40
               'id' => $event_category['id'],
41
               'name' => $event_category['name'],
42
           ]);
43
        }
44
    }
45
}
46