I'm trying to call the Illuminate\Http\Request has method from one of my controllers.
Request::has('fields')
Following from the documentation exactly, yet I'm getting an error thrown:
Non-static method Illuminate\Http\Request::has() should not be called statically, assuming $this from incompatible context
I'm not sure what I'm doing wrong here, I tried following the documentation as closely as possible.
The problem is you are using the wrong Request
class. You need to import the Facade:
use Illuminate\Support\Facades\Request;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With