title: Laravel 5.2 - How to return a PDF as part of a JSON response
body: <p>So I have developed an API and one of the endpoints is a report generator. Normally they send in the name of the report and some other variables and it pops out a PDF using <a href="https://github.com/barryvdh/laravel-snappy" rel="nofollow">Laravel-Snappy</a>. </p>
  
  <p>I am also using <a href="https://github.com/tymondesigns/jwt-auth" rel="nofollow">JWT-Auth</a> for authentication. Since I need to be HIPAA compliant I will be refreshing the token on EVERY call. For most endpoints this is easy as I just add it to the meta of my json response. </p>
  
  <p>However, for the reports they only return a PDF with headers to force download etc. Is there a way for me to send the PDF data as part of a JSON response that applications hitting this API would be able to use? Do I maybe need to encrypt it in some way that it can be sent with a json response? Any other ideas on any line of thought would be appreciated.</p>