title: can I use method dependency injection outside of a controller?
body: <p>if I have a function somewhere like:</p>
  
  <pre><code>public function test(Request $request, $param1, $param2)    
  </code></pre>
  
  <p>then call it somewhere else with:</p>
  
  <pre><code>$thing-&gt;test('abc','def')
  </code></pre>
  
  <p>PHPstorm gives me a sgwiggly line and says "Required paramater $param2 is missing" message.</p>
  
  <p>Does this sort of thing only work in a controller or can I make it work elsewhere? Or will it work if I ran it and PHPstorm just thinks it doesn't? </p>
  
  <p><a href="http://laravel.com/docs/5.0/controllers#dependency-injection-and-controllers" rel="nofollow">http://laravel.com/docs/5.0/controllers#dependency-injection-and-controllers</a></p>