MainComposer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace App\Http\ViewComposers;
4
use App\Repositories\LotRepository;
5
use Illuminate\Contracts\View\View;
6
7
class MainComposer extends Composer
8
{
9
    /**
10
     * @var LotRepository
11
     */
12
    protected $lots;
13
14
15
    /**
16
     * AddLotComposer constructor.
17
     * @param LotRepository $lotRepository
18
     */
19
    public function __construct(
20
        LotRepository $lotRepository
21
    ) {
22
        $this->lots = $lotRepository;
23
    }
24
25
    /**
26
     * Bind view to data.
27
     * 
28
     * @param View $view
29
     * @return $this
30
     */
31
    public function compose(View $view)
32
    {
33
        $comision   = \Auth::check() ? $this->lots->userLotsPendingComision(\Auth::user()) : 0;
34
        return $view
35
            ->with('comision', $comision);
36
    }
37
}