1 | <?php |
||
15 | class Handler extends ExceptionHandler |
||
16 | { |
||
17 | /** |
||
18 | * A list of the exception types that should not be reported. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $dontReport = [ |
||
23 | AuthorizationException::class, |
||
24 | HttpException::class, |
||
25 | ModelNotFoundException::class, |
||
26 | ValidationException::class, |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * Report or log an exception. |
||
31 | * |
||
32 | * This is a great spot to send exceptions to Sentry, Bugsnag, etc. |
||
33 | * |
||
34 | * @param \Exception $e |
||
35 | * @return void |
||
36 | */ |
||
37 | public function report(Exception $e) |
||
41 | |||
42 | /** |
||
43 | * Render an exception into an HTTP response. |
||
44 | * |
||
45 | * @param \Illuminate\Http\Request $request |
||
46 | * @param \Exception $e |
||
47 | * @return \Illuminate\Http\Response |
||
48 | */ |
||
49 | public function render($request, Exception $e) |
||
65 | } |
||
66 |
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: