summaryrefslogtreecommitdiff
path: root/src/AuthLogServiceProvider.php
blob: f104997630c317c8fcd3a5443843426f39b85405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace Lightscale\LaralightAuthLog;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;

class AuthLogServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        $ns = "laralight-auth-log";
        $dir = __DIR__;
        $root = "{$dir}/..";

        $this->publishesMigrations([
            "{$root}/database/migrations" => database_path('migrations', "{$ns}:migrations"),
        ]);

        $this->mergeConfigFrom("$root/config/auth_log.php", 'auth_log');
        $this->publishes([
            "{$root}/config/access_log.php" => config_path('auth_log.php'),
        ], "{$ns}:config");

        Event::subscribe(AuthSubscriber::class);
    }
}