Completed
Push — menu ( c44646 )
by Fèvre
10:48
created

BlogSidebarServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 1
1
<?php
2
namespace Xetaravel\Http\ViewComposers;
3
4
use Xetaravel\Models\Repositories\ArticleRepository;
5
use Xetaravel\Models\Repositories\CategoryRepository;
6
use Illuminate\Support\Facades\View;
7
use Illuminate\Support\ServiceProvider;
8
9
class BlogSidebarServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register bindings in the container.
13
     *
14
     * @return void
15
     */
16
    public function boot()
17
    {
18
        View::composer('partials.blog._sidebar', function ($view) {
19
            $articles = ArticleRepository::sidebar();
20
            $categories = CategoryRepository::sidebar();
21
22
            $view->with(['articles' => $articles, 'categories' => $categories]);
23
        });
24
    }
25
}
26