1 | <?php namespace Arcanesoft\Auth\Http\Controllers\Admin; |
||
16 | class PermissionsController extends Controller |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Traits |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | use JsonResponses; |
||
24 | |||
25 | /* ----------------------------------------------------------------- |
||
26 | | Properties |
||
27 | | ----------------------------------------------------------------- |
||
28 | */ |
||
29 | |||
30 | /** @var \Arcanesoft\Contracts\Auth\Models\Permission|\Arcanesoft\Auth\Models\Permission */ |
||
31 | protected $permission; |
||
32 | |||
33 | /** @var int */ |
||
34 | protected $perPage = 30; |
||
35 | |||
36 | /* ----------------------------------------------------------------- |
||
37 | | Constructor |
||
38 | | ----------------------------------------------------------------- |
||
39 | */ |
||
40 | |||
41 | /** |
||
42 | * Instantiate the controller. |
||
43 | * |
||
44 | * @param \Arcanesoft\Contracts\Auth\Models\Permission $permission |
||
45 | */ |
||
46 | public function __construct(Permission $permission) |
||
55 | |||
56 | /* ----------------------------------------------------------------- |
||
57 | | Main Methods |
||
58 | | ----------------------------------------------------------------- |
||
59 | */ |
||
60 | |||
61 | public function index() |
||
75 | |||
76 | public function group(PermissionsGroup $group) |
||
94 | |||
95 | public function show(Permission $permission) |
||
106 | |||
107 | public function detachRole(Permission $permission, Role $role) |
||
126 | |||
127 | /* ----------------------------------------------------------------- |
||
128 | | Other Methods |
||
129 | | ----------------------------------------------------------------- |
||
130 | */ |
||
131 | |||
132 | /** |
||
133 | * Notify with translation. |
||
134 | * |
||
135 | * @param string $action |
||
136 | * @param array $replace |
||
137 | * @param array $context |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | protected function transNotification($action, array $replace = [], array $context = []) |
||
151 | } |
||
152 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: