Passed
Push — master ( 4a884d...c9d1fc )
by Jeff
12:14
created

PermissionController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Controllers\Admin\Permissions;
4
5
use App\Http\Controllers\Controller;
6
use App\Shop\Permissions\Repositories\PermissionRepository;
7
8
class PermissionController extends Controller
9
{
10
    /**
11
     * @var PermissionRepository
12
     */
13
    private $permRepo;
14
15
    /**
16
     * PermissionController constructor.
17
     *
18
     * @param PermissionRepository $permissionRepository
19
     */
20
    public function __construct(PermissionRepository $permissionRepository)
21
    {
22
        $this->permRepo = $permissionRepository;
23
    }
24
25
    /**
26
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
27
     */
28
    public function index()
29
    {
30
        $list = $this->permRepo->listPermissions();
31
32
        $permissions = $this->permRepo->paginateArrayResults($list->all());
33
34
        return view('admin.permissions.list', compact('permissions'));
35
    }
36
}
37