According to the Laravel documentation Request is acquired via dependency injection. For a controller this is fine, but how do we access Request object outside a controller, for example in a view
According to the Laravel documentation Request is acquired via dependency injection. For a controller this is fine, but how do we access Request object outside a controller, for example in a view
在拉维尔有一个请求助手.您可以在任何地方使用请求对象.
request()->field_name
Here's laravel documentation link for request helper https://laravel.com/docs/5.2/helpers#method-request