| 1 | <?php |
||
| 9 | class PermissionsCount extends Widget |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * The configuration array. |
||
| 13 | * |
||
| 14 | * @var array |
||
| 15 | */ |
||
| 16 | protected $config = [ |
||
| 17 | 'background' => 'bg-white', |
||
| 18 | 'icon-background' => 'red', |
||
| 19 | 'text' => 'dark' |
||
| 20 | ]; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Treat this method as a controller action. |
||
| 24 | * Return view() or other content to display. |
||
| 25 | */ |
||
| 26 | public function run() |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Determine if the widget should be displayed. |
||
| 39 | * |
||
| 40 | * @return bool |
||
| 41 | */ |
||
| 42 | public function shouldBeDisplayed() |
||
| 46 | } |
||
| 47 |
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: