Laravel 5 Non Static Method Request::ajax() Should Not Be Called Statically

Diego Cortés
Full Stack Developer & SEO Specialist

Hello everyone, today we will see how to solve the following error when using Request::ajax() to verify that the request is via ajax, the error is the following:
Non-static method Illuminate\Http\Request::ajax() should not be called statically
Solution:
The solution is very easy! Simply within our controller that we are using we must replace the line:
Read also
use Illuminate\Http\Request
by:
use Request;
Now it should work perfectly, at least for me :D, I hope it helps more than one.