Life4Cali Life4Cali - 11 months ago 61
PHP Question

Laravel 5 Illuminate\Http\Request has method not allowing static call

I'm trying to call the Illuminate\Http\Request has method from one of my controllers.


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;