title: How to add in response HTTP data in Laravel?
body: <p>Now that to get data I call method from controller, that returns data as JSON:</p>
  
  <pre><code>return response()-&gt;json([$data]);
  </code></pre>
  
  <p>Can I add to this response global data? And merge this <code>$data</code>?</p>
  
  <p>For example I have global <code>$user</code> object that I want to give away in each HTTP response to avoid the following entry in each method:</p>
  
  <pre><code>return response()-&gt;json(["data" =&gt; $data, "user" =&gt; $user]);
  </code></pre>