Illuminate\Http\Request
guys Im a novice here so please forgive my ignorance
but what is the difference between
use Illuminate\Http\Request;
use Request;
use App\Http\Requests;
ok I think I understand more or less
so a facade is just a fancy way of accessing the request method?
Are you sure that Request and Illuminate/Http/Request are the same ?
Because in my app, if I use Request, then call $request->file('file') for example, it fails.
However, if I use Illuminate/Http/Request, it succeed.
I have some trouble figuring this, even after trying to understand Facades.
For example, I have a controller that needs Request and Illuminate\Http\Request. The only way I found to make it work together is by using aliases:
use Illuminate\Http\Request as HttpRequest;
use Request;
I believe those two classes frequently used together, so I have the feeling something is wrong.
@chuckc Have it like this
use Illuminate\Http\Request;
public function index(Request $request)
{
var_dump($request->all());
dd($request->url());
}
You will see the POST/GET data and the current URL for the site. You can retrieve files from that.
$request->file('file');
Oh okay I see, the problem is that I used the static method.
Thanks @bashy
use App\Http\Requests
It simply means you can access all classes in use App\Http\Requests namespace(folder)...
Please or to participate in this conversation.