Completed
Push — master ( e43e24...a5d827 )
by ARCANEDEV
05:31
created

PermissionsController::show()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 0
cp 0
rs 9.4286
cc 1
eloc 5
nc 1
nop 1
crap 2
1
<?php namespace Arcanesoft\Auth\Http\Controllers\Foundation;
2
3
use Arcanesoft\Auth\Bases\FoundationController;
4
use Arcanesoft\Auth\Models\Permission;
5
6
/**
7
 * Class     PermissionsController
8
 *
9
 * @package  Arcanesoft\Auth\Http\Controllers\Foundation
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class PermissionsController extends FoundationController
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Constructor
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * Instantiate the controller.
20
     */
21
    public function __construct()
22
    {
23
        parent::__construct();
24
25
        $this->setCurrentPage('auth-permissions');
26
        $this->addBreadcrumbRoute('Permissions', 'auth::foundation.permissions.index');
27
    }
28
29
    /* ------------------------------------------------------------------------------------------------
30
     |  Main Functions
31
     | ------------------------------------------------------------------------------------------------
32
     */
33
    public function index()
34
    {
35
        $permissions = Permission::with('roles')->paginate(30);
36
37
        $title = 'List of permissions';
38
        $this->setTitle($title);
39
        $this->addBreadcrumb($title);
40
41
        return $this->view('foundation.permissions.list', compact('permissions'));
42
    }
43
44
    public function show(Permission $permission)
45
    {
46
        $title = 'Permission details';
47
        $this->setTitle($title);
48
        $this->addBreadcrumb($title);
49
50
        return $this->view('foundation.permissions.show', compact('permission'));
51
    }
52
}
53