title: Call Laravel controller from code and pass HTTP headers to it
body: <p>To call a controller I use a CURL request like this:</p>
  
  <pre><code>curl -kX POST https://site/method  -H 'Authorization: Bearer ACCESS_TOKEN\
  Content-Type:application/json' -d '
  {
      "param1":"value 1",
      "param2":"value 2",
      "param3":"value 3"
  }'
  </code></pre>
  
  <p>The route calls UserController@method.</p>
  
  <p>How can I do the same from Laravel code (internal request, not sending CURL)?</p>
  
  <p>I've found an advice to use something like this</p>
  
  <pre><code>        $controller = app()-&gt;make($controllerName);
          $response = app()-&gt;call([$controller, 'method'], []);
          echo $response;
  </code></pre>
  
  <p>where the last [] should contain some parameters. But if this is the way, I cannot figure out how the array should look in my case.</p>
  
  <p>P.S. Please, don't answer "it's a bad practice" instead of giving an advice how to implement what I need.</p>