LeafletServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 3
eloc 6
c 2
b 0
f 0
nc 3
nop 1
dl 0
loc 12
rs 10
1
<?php
2
3
namespace Bavix\Leaflet;
4
5
use Encore\Admin\Form;
6
use Illuminate\Support\ServiceProvider;
7
8
class LeafletServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function boot(Leaflet $extension)
14
    {
15
        if (!Leaflet::boot()) {
16
            return;
17
        }
18
19
        if ($views = $extension->views()) {
20
            $this->loadViewsFrom($views, 'laravel-admin-leaflet');
21
        }
22
23
        $this->app->booted(function() {
24
            Form::extend('leaflet', LeafletMap::class);
25
        });
26
    }
27
}
28