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