This PR fixes some issues with the error-handling code snippet for Laravel 11.
The main issue is that the closure did not accept the $request variable, which is used later.
Additionally, the Symfony\Component\HttpFoundation\Response type does not define the status method, so IDEs/static analysis think it's missing. I checked the actual class the closure receives and got Illuminate\Http\Request, where the status method is defined.
The only thing I'm not sure of is whether there is ever a situation where a different response class may be received in the closure, which won't pass the type check and may not contain the status method.
This PR fixes some issues with the error-handling code snippet for Laravel 11.
The main issue is that the closure did not accept the
$request
variable, which is used later.Additionally, the
Symfony\Component\HttpFoundation\Response
type does not define thestatus
method, so IDEs/static analysis think it's missing. I checked the actual class the closure receives and gotIlluminate\Http\Request
, where thestatus
method is defined.The only thing I'm not sure of is whether there is ever a situation where a different response class may be received in the closure, which won't pass the type check and may not contain the
status
method.