Illuminate\Http\Request::get() should not be called statically

Illuminate\Http\Request::get() should not be called statically

其实不只是get方法,all()等方法都不能被静态调用

原因如下:

all());
}
```

4、和第三种方法用法一样,不过是直接写在构造方法里面的

```
use Illuminate\Http\Request;

class YourController extends Controller
{
protected $request;

public function __construct(Request $request)
{
$this->request = $request;
}

public function sign_up_user(Request $request){
dd($this->request->all());
}
}
```

    A+
发布日期:2022年10月18日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: