NotifierDatabaseSeeder::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 21
c 1
b 0
f 1
dl 0
loc 31
rs 9.584
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Usamamuneerchaudhary\Notifier\Database\Seeders;
4
5
use Illuminate\Database\Seeder;
6
use Usamamuneerchaudhary\Notifier\Models\NotificationChannel;
7
use Usamamuneerchaudhary\Notifier\Models\NotificationEvent;
8
9
class NotifierDatabaseSeeder extends Seeder
10
{
11
    public function run(): void
12
    {
13
        // Create default channels
14
        NotificationChannel::create([
15
            'title' => 'Email',
16
            'type' => 'email',
17
            'icon' => 'heroicon-o-envelope',
18
            'is_active' => true,
19
        ]);
20
21
        NotificationChannel::create([
22
            'title' => 'Slack',
23
            'type' => 'slack',
24
            'icon' => 'heroicon-o-chat-bubble-left-right',
25
            'is_active' => true,
26
        ]);
27
28
        NotificationChannel::create([
29
            'title' => 'SMS',
30
            'type' => 'sms',
31
            'icon' => 'heroicon-o-device-phone-mobile',
32
            'is_active' => true,
33
        ]);
34
35
        // Create default events
36
        NotificationEvent::create([
37
            'group' => 'Projects',
38
            'name' => 'New Project Created',
39
            'key' => 'project.created',
40
            'description' => 'When a new project is created',
41
            'is_active' => true,
42
        ]);
43
44
    }
45
}
46