Completed
Push — master ( 22fa00...44c771 )
by ARCANEDEV
07:45
created

PermissionsCountComposer::compose()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php namespace Arcanesoft\Auth\ViewComposers\Dashboard;
2
3
use Arcanesoft\Auth\Models\Permission;
4
use Arcanesoft\Auth\ViewComposers\ViewComposer;
5
use Illuminate\Contracts\View\View;
6
7
class PermissionsCountComposer extends ViewComposer
8
{
9
    /* ------------------------------------------------------------------------------------------------
10
     |  Constants
11
     | ------------------------------------------------------------------------------------------------
12
     */
13
    const VIEW = 'auth::foundation._composers.dashboard.permissions-count-box';
14
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Main Functions
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    /**
20
     * Compose the view.
21
     *
22
     * @param  \Illuminate\Contracts\View\View  $view
23
     */
24
    public function compose(View $view)
25
    {
26
        $view->with('permissionsCount', $this->getCachedPermissions()->count());
27
    }
28
}
29