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

UsersCountComposer::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\User;
4
use Arcanesoft\Auth\ViewComposers\ViewComposer;
5
use Illuminate\Contracts\View\View;
6
7
/**
8
 * Class     UsersCountComposer
9
 *
10
 * @package  Arcanesoft\Auth\ViewComposers\Dashboard
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class UsersCountComposer extends ViewComposer
14
{
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Constants
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    const VIEW = 'auth::foundation._composers.dashboard.users-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('usersCount', $this->getCachedUsers()->count());
33
    }
34
}
35