The expression return response('', 204) could return the type Illuminate\Contracts\Routing\ResponseFactory which is incompatible with the type-hinted return Symfony\Component\HttpFoundation\Response. Consider adding an additional type-check to rule them out.