I have a question what is the diffrence between \Illuminate\Http\Request and the Request classes in laravel 5. I've use the \Illuminate\Http\Request class for some ajax based thing in blade form.When using \Illuminate\Http\Request shows an error,
Non-static method Illuminate\Http\Request::ajax() should not be called statically, assuming $this from incompatible context
This is the codeblock what I've used
Route::post('org_tree',function(\Illuminate\Http\Request $request)
{
if(Request::ajax())
{
}
});
What is the reason for that?
Request
class is simply a Laravel Facade that wraps an instance of\Illuminate\Http\Request
. Facades are nothing more than syntactic sugar to grant you static access to the underlying class methods. – maiorano84