LaravelExceptionNotifier::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 0
c 2
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace jeremykenedy\laravelexceptionnotifier;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class LaravelExceptionNotifier extends ServiceProvider
8
{
9
    private $_packageTag = 'laravelexceptionnotifier';
10
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = false;
17
18
    /**
19
     * Bootstrap the application services.
20
     *
21
     * @return void
22
     */
23
    public function boot()
24
    {
25
        //
26
    }
27
28
    /**
29
     * Register the application services.
30
     *
31
     * @return void
32
     */
33
    public function register()
34
    {
35
        $this->loadViewsFrom(__DIR__.'/resources/views/', $this->_packageTag);
36
        $this->mergeConfigFrom(__DIR__.'/config/exceptions.php', $this->_packageTag);
37
        $this->publishFiles();
38
    }
39
40
    /**
41
     * Publish files for package.
42
     *
43
     * @return void
44
     */
45
    private function publishFiles()
46
    {
47
        $publishTag = $this->_packageTag;
48
49
        // Publish Mailer
50
        $this->publishes([
51
            __DIR__.'/App/Mail/ExceptionOccured.php' => app_path('Mail/ExceptionOccured.php'),
52
        ], $publishTag);
53
54
        // Publish email view
55
        $this->publishes([
56
            __DIR__.'/resources/views/emails/exception.blade.php' => resource_path('views/emails/exception.blade.php'),
57
        ], $publishTag);
58
59
        // Publish config file
60
        $this->publishes([
61
            __DIR__.'/config/exceptions.php' => config_path('exceptions.php'),
62
        ], $publishTag);
63
    }
64
}
65