registerPublishing()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Mydnic\FormBladeComponents;
4
5
use Illuminate\Support\Facades\Blade;
6
use Illuminate\Support\Facades\Route;
7
use Illuminate\Support\ServiceProvider;
8
9
class FormBladeComponentsServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register any package services.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        if ($this->app->runningInConsole()) {
19
            $this->registerPublishing();
20
        }
21
    }
22
23
    public function boot()
24
    {
25
        $this->registerBladeComponents();
26
    }
27
28
    private function registerBladeComponents()
29
    {
30
        Blade::aliasComponent('components.form.input', 'input');
0 ignored issues
show
Bug introduced by
The method aliasComponent() does not exist on Illuminate\Support\Facades\Blade. Did you maybe mean component()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
31
        Blade::aliasComponent('components.form.textarea', 'textarea');
0 ignored issues
show
Bug introduced by
The method aliasComponent() does not exist on Illuminate\Support\Facades\Blade. Did you maybe mean component()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
32
        Blade::aliasComponent('components.form.select', 'select');
0 ignored issues
show
Bug introduced by
The method aliasComponent() does not exist on Illuminate\Support\Facades\Blade. Did you maybe mean component()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
33
        Blade::aliasComponent('components.form.checkbox', 'checkbox');
0 ignored issues
show
Bug introduced by
The method aliasComponent() does not exist on Illuminate\Support\Facades\Blade. Did you maybe mean component()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
34
    }
35
36
    public function registerPublishing()
37
    {
38
        $this->publishes([
39
            __DIR__ . '/../resources/views/components' => resource_path('views/components'),
40
        ], 'blade-components');
41
    }
42
}
43