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

RolesCountComposer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 22
ccs 0
cts 3
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 4 1
1
<?php namespace Arcanesoft\Auth\ViewComposers\Dashboard;
2
3
use Arcanesoft\Auth\Models\Role;
4
use Arcanesoft\Auth\ViewComposers\ViewComposer;
5
use Illuminate\Contracts\View\View;
6
7
/**
8
 * Class     RolesCountComposer
9
 *
10
 * @package  Arcanesoft\Auth\ViewComposers\Dashboard
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class RolesCountComposer extends ViewComposer
14
{
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Constants
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    const VIEW = 'auth::foundation._composers.dashboard.roles-count-box';
20
21
    /* ------------------------------------------------------------------------------------------------
22
     |  Main Functions
23
     | ------------------------------------------------------------------------------------------------
24
     */
25
    /**
26
     * Compose the view.
27
     *
28
     * @param  \Illuminate\Contracts\View\View  $view
29
     */
30
    public function compose(View $view)
31
    {
32
        $view->with('rolesCount', $this->getCachedRoles()->count());
33
    }
34
}
35
36