Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
22 / 22
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
ViewServiceProvider
100.00% covered (success)
100.00%
22 / 22
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 register
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 boot
100.00% covered (success)
100.00%
21 / 21
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Hyde\Foundation\Providers;
6
7use Hyde\Hyde;
8use Illuminate\Support\Facades\Blade;
9use Illuminate\Support\ServiceProvider;
10use Hyde\Framework\Views\Components\LinkComponent;
11use Hyde\Framework\Views\Components\BreadcrumbsComponent;
12
13use function resource_path;
14
15/**
16 * Register the Hyde view components.
17 */
18class ViewServiceProvider extends ServiceProvider
19{
20    public function register(): void
21    {
22        //
23    }
24
25    public function boot(): void
26    {
27        $this->loadViewsFrom(__DIR__.'/../../../resources/views', 'hyde');
28
29        $this->publishes([
30            __DIR__.'/../../../resources/views/layouts' => resource_path('views/vendor/hyde/layouts'),
31        ], 'hyde-layouts');
32
33        $this->publishes([
34            __DIR__.'/../../../resources/views/components' => resource_path('views/vendor/hyde/components'),
35        ], 'hyde-components');
36
37        $this->publishes([
38            Hyde::vendorPath('resources/views/pages/404.blade.php') => Hyde::path('_pages/404.blade.php'),
39        ], 'hyde-page-404');
40
41        $this->publishes([
42            Hyde::vendorPath('resources/views/homepages/welcome.blade.php') => Hyde::path('_pages/index.blade.php'),
43        ], 'hyde-welcome-page');
44
45        $this->publishes([
46            Hyde::vendorPath('resources/views/homepages/post-feed.blade.php') => Hyde::path('_pages/index.blade.php'),
47        ], 'hyde-posts-page');
48
49        $this->publishes([
50            Hyde::vendorPath('resources/views/homepages/blank.blade.php') => Hyde::path('_pages/index.blade.php'),
51        ], 'hyde-blank-page');
52
53        Blade::component('link', LinkComponent::class);
54        Blade::component('hyde::breadcrumbs', BreadcrumbsComponent::class);
55    }
56}