TagHelperServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace BeyondCode\TagHelper;
4
5
use Illuminate\Support\ServiceProvider;
6
use BeyondCode\TagHelper\Helpers\AuthHelper;
7
use BeyondCode\TagHelper\Helpers\CsrfHelper;
8
use BeyondCode\TagHelper\Helpers\LinkHelper;
9
use BeyondCode\TagHelper\Helpers\GuestHelper;
10
use BeyondCode\TagHelper\Helpers\ConditionHelper;
11
use BeyondCode\TagHelper\Helpers\FormMethodHelper;
12
13
class TagHelperServiceProvider extends ServiceProvider
14
{
15
    /**
16
     * Register the application services.
17
     */
18
    public function register()
19
    {
20
        $this->app->singleton(TagHelper::class);
21
22
        $this->app->alias(TagHelper::class, 'tag-helper');
23
    }
24
25
    /**
26
     * Bootstrap the application services.
27
     */
28
    public function boot()
29
    {
30
        $this->app['blade.compiler']->extend(function ($view) {
31
            return $this->app[TagHelperCompiler::class]->compile($view);
32
        });
33
34
        $this->app['tag-helper']->helper(LinkHelper::class);
35
        $this->app['tag-helper']->helper(FormMethodHelper::class);
36
        $this->app['tag-helper']->helper(CsrfHelper::class);
37
        $this->app['tag-helper']->helper(ConditionHelper::class);
38
        $this->app['tag-helper']->helper(AuthHelper::class);
39
        $this->app['tag-helper']->helper(GuestHelper::class);
40
    }
41
}
42