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

PermissionsController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 3
c 4
b 0
f 0
lcom 1
cbo 3
dl 0
loc 41
ccs 0
cts 9
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A index() 0 10 1
A show() 0 8 1
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