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

DiscussSidebarServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 16
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 1
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