Stream a PDF file in Laravel 5.2
<p><strong>Hi everyone!</strong> I'm working on a Laravel 5.2 application in which the user can download a variety of files. One of these is a 'User guide', explaining how the website is set up and functionalities etc. I would like the PDF to be streamed in another page, so that the user is still within the application. The controller which I am using is: </p>

<pre><code>public function userguidePDF(){

    return response()-&gt;stream('../public/download/userguide.pdf');

}
</code></pre>

<p>But this returns: </p>

<blockquote>
  <p>Argument 1 passed to
  Symfony\Component\HttpFoundation\StreamedResponse::__construct() must
  be callable, string given, called in
  /path/to/laravel/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php
  on line 117 and defined</p>
</blockquote>

<p>I have searched on the internet for a method, which leaded me to the following syntax: </p>

<pre><code> return response()-&gt;stream($callback, 200, $headers);
</code></pre>

<p>Unfortunately, I am unable to find more documentation on the parameters because I don't understand them. Could someone please explain to me what the <code>$callback, 200, $header</code> are as parameters and how I can use this?  </p>