Laravel Request: it's correct injecting Request directly in the controller constructor?
<p>In a Laravel Controller, if all the functions use Request, it's correct to inject the Request directly in the constructor instead of the function?</p>

<p>The code below works, I was just wondering if it's correct and if it has side effects...</p>

<pre><code>class BananaController extends Controller
{

protected $request; // request as an attribute of the controllers

public function __construct(Request $request)
{
    $this-&gt;middleware('auth');
    $this-&gt;request = $request; // Request becomes available for all the controller functions that call $this-&gt;request
}

public function store()
{
    $this-&gt;validate($this-&gt;request, [
    'text' =&gt; 'required',
    ]);

    // I save the banana attributes and the controller continues...
</code></pre>

<p>Go easy on me, first question on stackoverflow ever :-)</p>

<p>[ADDENDUM] To be clear, the "conventional" code would be:</p>

<pre><code>class BananaController extends Controller
{

public function __construct()
{
    $this-&gt;middleware('auth');
}

public function store(Request $request)
{
    $this-&gt;validate($request, [
    'text' =&gt; 'required',
    ]);

    // I save the banana attributes and the controller continues...
</code></pre>