| 1 | <?php |
||
| 8 | class MassDeleteTool extends AbstractTool |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Set CRUD object. |
||
| 12 | * |
||
| 13 | * @param CRUD $crud |
||
| 14 | */ |
||
| 15 | 1 | public function setCrud(CRUD $crud) |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Position where should tool be placed. |
||
| 26 | */ |
||
| 27 | public function position() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Unique tool identifier. |
||
| 34 | */ |
||
| 35 | 1 | public function identifier(): string |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Tool's view. |
||
| 42 | */ |
||
| 43 | public function render() |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Handle tool execution. |
||
| 53 | * |
||
| 54 | * @param Request $request |
||
| 55 | * |
||
| 56 | * @return \Illuminate\Http\JsonResponse |
||
| 57 | */ |
||
| 58 | public function handle(Request $request) |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Check allowance to show and process tool. |
||
| 89 | */ |
||
| 90 | 1 | public function check(): bool |
|
| 94 | } |
||
| 95 |
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: