title: How to inject dependencies to a laravel job
body: <p>I'm adding a laravel job to my queue from my controller as such</p>
  
  <pre><code>$this-&gt;dispatchFromArray(
      'ExportCustomersSearchJob',
      [
          'userId' =&gt; $id,
          'clientId' =&gt; $clientId
      ]
  );
  </code></pre>
  
  <p>I would like to inject the <code>userRepository</code> as a dependency when implementing the <code>ExportCustomersSearchJob</code> class. Please how can I do that?</p>
  
  <p>I have this but it doesn't work</p>
  
  <pre><code>class ExportCustomersSearchJob extends Job implements SelfHandling, ShouldQueue
  {
      use InteractsWithQueue, SerializesModels, DispatchesJobs;
  
      private $userId;
  
      private $clientId;
  
      private $userRepository;
  
  
      /**
       * Create a new job instance.
       *
       * @return void
       */
      public function __construct($userId, $clientId, $userRepository)
      {
          $this-&gt;userId = $userId;
          $this-&gt;clientId = $clientId;
          $this-&gt;userRepository = $userRepository;
      }
  }
  </code></pre>