Passed
Push — master ( 20e830...0a10dc )
by Caen
04:06 queued 12s
created

ViewServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 20
c 3
b 0
f 0
nc 1
nop 0
dl 0
loc 29
rs 9.6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Foundation\Providers;
6
7
use Hyde\Framework\Views\Components\LinkComponent;
8
use Hyde\Hyde;
9
use Illuminate\Support\Facades\Blade;
10
use Illuminate\Support\ServiceProvider;
11
12
class ViewServiceProvider extends ServiceProvider
13
{
14
    public function register(): void
15
    {
16
        //
17
    }
18
19
    public function boot(): void
20
    {
21
        $this->loadViewsFrom(__DIR__.'/../../../resources/views', 'hyde');
22
23
        $this->publishes([
24
            __DIR__.'/../../../resources/views/layouts' => resource_path('views/vendor/hyde/layouts'),
25
        ], 'hyde-layouts');
26
27
        $this->publishes([
28
            __DIR__.'/../../../resources/views/components' => resource_path('views/vendor/hyde/components'),
29
        ], 'hyde-components');
30
31
        $this->publishes([
32
            Hyde::vendorPath('resources/views/pages/404.blade.php') => Hyde::path('_pages/404.blade.php'),
33
        ], 'hyde-page-404');
34
35
        $this->publishes([
36
            Hyde::vendorPath('resources/views/homepages/welcome.blade.php') => Hyde::path('_pages/index.blade.php'),
37
        ], 'hyde-welcome-page');
38
39
        $this->publishes([
40
            Hyde::vendorPath('resources/views/homepages/post-feed.blade.php') => Hyde::path('_pages/index.blade.php'),
41
        ], 'hyde-posts-page');
42
43
        $this->publishes([
44
            Hyde::vendorPath('resources/views/homepages/blank.blade.php') => Hyde::path('_pages/index.blade.php'),
45
        ], 'hyde-blank-page');
46
47
        Blade::component('link', LinkComponent::class);
48
    }
49
}
50