1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Pratiksh\Adminetic\Http\Controllers\Admin; |
4
|
|
|
|
5
|
|
|
use App\Http\Controllers\Controller; |
|
|
|
|
6
|
|
|
use Illuminate\Http\Request; |
7
|
|
|
use Pratiksh\Adminetic\Contracts\RoleRepositoryInterface; |
8
|
|
|
use Pratiksh\Adminetic\Http\Requests\RoleRequest; |
9
|
|
|
use Pratiksh\Adminetic\Models\Admin\Permission; |
10
|
|
|
use Pratiksh\Adminetic\Models\Admin\Role; |
11
|
|
|
|
12
|
|
|
class RoleController extends Controller |
13
|
|
|
{ |
14
|
|
|
protected $roleRepositoryInterface; |
15
|
|
|
|
16
|
|
|
public function __construct(RoleRepositoryInterface $roleRepositoryInterface) |
17
|
|
|
{ |
18
|
|
|
$this->roleRepositoryInterface = $roleRepositoryInterface; |
19
|
|
|
$this->authorizeResource(Role::class, 'role'); |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Display a listing of the resource. |
24
|
|
|
* |
25
|
|
|
* @return \Illuminate\Http\Response |
26
|
|
|
*/ |
27
|
|
|
public function index() |
28
|
|
|
{ |
29
|
|
|
return view('adminetic::admin.role.index', $this->roleRepositoryInterface->indexRole()); |
|
|
|
|
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Show the form for creating a new resource. |
34
|
|
|
* |
35
|
|
|
* @return \Illuminate\Http\Response |
36
|
|
|
*/ |
37
|
|
|
public function create() |
38
|
|
|
{ |
39
|
|
|
return view('adminetic::admin.role.create'); |
|
|
|
|
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Store a newly created resource in storage. |
44
|
|
|
* |
45
|
|
|
* @param \Pratiksh\Adminetic\Http\Requests\RoleRequest $request |
46
|
|
|
* @return \Illuminate\Http\Response |
47
|
|
|
*/ |
48
|
|
|
public function store(RoleRequest $request) |
49
|
|
|
{ |
50
|
|
|
$this->roleRepositoryInterface->storeRole($request); |
51
|
|
|
|
52
|
|
|
return redirect(adminRedirectRoute('role'))->withSuccess('Role Created Successfully.'); |
|
|
|
|
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Display the specified resource. |
57
|
|
|
* |
58
|
|
|
* @param \Pratiksh\Adminetic\Models\Admin\Role $role |
59
|
|
|
* @return \Illuminate\Http\Response |
60
|
|
|
*/ |
61
|
|
|
public function show(Role $role) |
62
|
|
|
{ |
63
|
|
|
return view('adminetic::admin.role.show', $this->roleRepositoryInterface->showRole($role)); |
|
|
|
|
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Show the form for editing the specified resource. |
68
|
|
|
* |
69
|
|
|
* @param \Pratiksh\Adminetic\Models\Admin\Role $role |
70
|
|
|
* @return \Illuminate\Http\Response |
71
|
|
|
*/ |
72
|
|
|
public function edit(Role $role) |
73
|
|
|
{ |
74
|
|
|
return view('adminetic::admin.role.edit', $this->roleRepositoryInterface->editRole($role)); |
|
|
|
|
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Update the specified resource in storage. |
79
|
|
|
* |
80
|
|
|
* @param \Pratiksh\Adminetic\Http\Requests\RoleRequest $request |
81
|
|
|
* @param \Pratiksh\Adminetic\Models\Admin\Role $role |
82
|
|
|
* @return \Illuminate\Http\Response |
83
|
|
|
*/ |
84
|
|
|
public function update(RoleRequest $request, Role $role) |
85
|
|
|
{ |
86
|
|
|
$this->roleRepositoryInterface->updateRole($request, $role); |
87
|
|
|
|
88
|
|
|
return redirect(adminRedirectRoute('role'))->withInfo('Role Updated Successfully.'); |
|
|
|
|
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Remove the specified resource from storage. |
93
|
|
|
* |
94
|
|
|
* @param \Pratiksh\Adminetic\Models\Admin\Role $role |
95
|
|
|
* @return \Illuminate\Http\Response |
96
|
|
|
*/ |
97
|
|
|
public function destroy(Role $role) |
98
|
|
|
{ |
99
|
|
|
$this->roleRepositoryInterface->destroyRole($role); |
100
|
|
|
|
101
|
|
|
return redirect(adminRedirectRoute('role'))->withFail('Role Deleted Successfully.'); |
|
|
|
|
102
|
|
|
} |
103
|
|
|
} |
104
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths