Completed
Push — master ( d44ef5...c7e879 )
by Fèvre
12s
created

DiscussSidebarServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
namespace Xetaravel\Http\ViewComposers;
3
4
use Xetaravel\Models\Repositories\DiscussCategoryRepository;
5
use Illuminate\Support\Facades\View;
6
use Illuminate\Support\ServiceProvider;
7
8
class DiscussSidebarServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Register bindings in the container.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        View::composer('Discuss::partials._sidebar', function ($view) {
18
            $categories = DiscussCategoryRepository::sidebar();
19
20
            $view->with(['categories' => $categories]);
21
        });
22
    }
23
}
24