EventServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 32
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 5 1
1
<?php
2
3
namespace App\Providers;
4
5
use App\Entities\User;
6
use App\Listeners\DatabaseListener;
7
use App\Listeners\LoginListener;
8
use App\Listeners\UserDeletedObserver;
9
use Illuminate\Auth\Events\Failed;
10
use Illuminate\Auth\Events\Login;
11
use Illuminate\Auth\Events\Registered;
12
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
13
use Illuminate\Database\Events\QueryExecuted;
14
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
15
16
class EventServiceProvider extends ServiceProvider
17
{
18
    /**
19
     * The event listener mappings for the application.
20
     *
21
     * @var array
22
     */
23
    protected $listen = [
24
        Registered::class    => [
25
            SendEmailVerificationNotification::class,
26
        ],
27
        Login::class         => [
28
            LoginListener::class,
29
        ],
30
        Failed::class        => [
31
            LoginListener::class,
32
        ],
33
        QueryExecuted::class => [
34
            DatabaseListener::class,
35
        ],
36
    ];
37
38
    /**
39
     * Register any events for your application.
40
     *
41
     * @return void
42
     */
43
    public function boot()
44
    {
45
        parent::boot();
46
47
        User::deleted(UserDeletedObserver::class);
48
    }
49
}
50