EventCategoriesTableSeeder::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 0
dl 0
loc 20
rs 9.7666
c 0
b 0
f 0
1
<?php
2
3
namespace Database\Seeders;
4
5
use App\Models\EventCategory;
6
use Illuminate\Database\Seeder;
7
use Illuminate\Support\Facades\DB;
8
9
class EventCategoriesTableSeeder extends Seeder
10
{
11
    /**
12
     * Run the database seeds.
13
     *
14
     * @return void
15
     */
16
    public function run()
17
    {
18
        $event_categories = [
19
            ['name' => 'Regular Jam'],
20
            ['name' => 'Class'],
21
            ['name' => 'Workshop'],
22
            ['name' => 'Festival'],
23
            ['name' => 'Special Jam'],
24
            ['name' => 'Underscore'],
25
            ['name' => 'Teachers Meeting'],
26
            ['name' => 'Performance'],
27
            ['name' => 'Lecture / Conference / Film'],
28
            ['name' => 'Lab'],
29
            ['name' => 'Camp / Journey'],
30
            ['name' => 'Other event'],
31
        ];
32
33
        // Seeding in this way to automatically create the slug with spatie/laravel-sluggable
34
        collect($event_categories)->each(function ($event_category) {
35
            EventCategory::create($event_category);
36
        });
37
38
    }
39
}
40