laravel 6 报错Symfony\Component\HttpFoundation\Request::isMethod() should not be called statically

laravel 6 使用Request 时报错Request::isMethod() should not be called statically

ErrorException
Non-static method Symfony\Component\HttpFoundation\Request::isMethod() should not be called statically

找到的英文提示是:The error message is due to the call not going through the Request facade。

解决办法是将:

use Illuminate\Http\Request;

改成:

use Request;

版权声明:本文为omaigao原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。