PermissionsComposer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A composeRolePermissions() 0 8 1
1
<?php namespace Arcanesoft\Auth\ViewComposers;
2
3
use Arcanesoft\Auth\Models\Permission;
4
use Illuminate\Contracts\View\View;
5
6
/**
7
 * Class     PermissionsComposer
8
 *
9
 * @package  Arcanesoft\Auth\ViewComposers
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class PermissionsComposer extends ViewComposer
13
{
14
    /* -----------------------------------------------------------------
15
     |  Main Methods
16
     | -----------------------------------------------------------------
17
     */
18
    /**
19
     * Compose the view.
20
     *
21
     * @param  \Illuminate\Contracts\View\View  $view
22
     */
23
    public function composeRolePermissions(View $view)
24
    {
25
        $permissions = $this->cacheResults('permissions.form', function () {
26
            return Permission::with(['group'])->orderBy('group_id', 'desc')->get();
27
        });
28
29
        $view->with('permissions', $permissions);
30
    }
31
}
32