Request::all(), always end on error
Hi,
I'm creating controllers using artisan command make:controller. So my controller files are partly ready.
I use a lot the Request::all() to get data on posts and gets, and the controller file created by artisan alredy came with the uses for App\Http\Requests; and Illuminate\Http\Request;
But when I call Resquest::all() on my function, I get this error: "Non-static method Illuminate\Http\Request::all() should not be called statically, assuming $this from incompatible context"
Off course I'm doing something wrong, but to fix it, the only way I know is to comment the mentioned calls, and add a use Request; only, as shown below.
// use App\Http\Requests; // use Illuminate\Http\Request; use Request;
Is this something wrong with artisan, or I'm really using Resquest in a wrong way?
thanks!
Yeh, you're using it wrong. The request instance is Illuminate\Http\Request, but the facade is Illuminate\Support\Facades\Request. Make sense?
Thanks @GrahamCampbell !
I read the docs on Laravel and I couldn't find why I'm using it wrong… I know this doesn't need to be explained here, but can you help?
Thanks, again :/