I'm trying to use
* Search for a specified resource.
* @return Response
public function search(Booking $booking, Input $input)
dd($input->all()); // this doesn't work
dd(Input::all()); // this DOES work
Call to undefined method Illuminate\Support\Facades\Input::all()
I don't think you're supposed to inject Facades into your Controllers.
Input is a facade for
Illuminate\Http\Request and it's service container binding is
request. So according to the documentation, in Laravel 5 you can do
Request::all() and in Laravel 5.1 you can do
EDIT: This post gives some more in-depth information: http://stackoverflow.com/a/29961400/2433843
EDIT3: I think it would be great if someone could explain WHY exactly you can't inject Facades into your Controllers. I understand DI and Facades are two different things entirely, and L5+ is pushing the developers towards DI. I just don't exactly understand why injecting a facade wouldn't work, since it points towards another class, and it works when you do not inject it. Not to forget Facades and Aliases are two seperate things too. I hope someone can elaborate on this.