EventCategoriesTableSeeder::run()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 21
rs 9.7
c 0
b 0
f 0
cc 2
nc 2
nop 0
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