title: Laravel - Queue Jobs - How to get a job based on the argument passed to it when dispatching
body: <p>I have multiple records in my accounts table. and I have one job let's call it <code>MasterJob</code> triggered every 5 minutes minutes. this job handle function will loop through my accounts and dispatch <code>jobA</code> for each of those accounts. eg: <code>dispatch JobA($accountId1), dispatch JobA($accountId2)..etc.</code></p>
  <p>here is a code sample:</p>
  <pre><code>class MasterJob implements ShouldQueue
  {
      public function handle()
      {
         $accounts = Account::all();
         foreach($accounts as $account)
         {
             JobA::dispatch($account); 
             //$account has all the details of the record including id and other details
         }
      }
  }
  </code></pre>
  <p>The problem comes when <code>JobA(1)</code> takes more than 5minutes to process. in this case, the <code>MasterJob</code> is triggered again and therefore it will dispatch another <code>JobA($accountId1)</code> even though the previous one isn't fully processed.</p>
  <p>What i want to achieve is: don't dispatch only those that are still processed. for example: don't dispatch <code>JobA(1)</code> again, but u can dispatch <code>JobA(2)</code> and <code>JobA(3)</code> without a problem.</p>
  <p>the only thing i found was the <code>withoutOverlapping()</code> function but it's not helpful in my scenario. is there anyway i can check that a job for that account isn't running before i dispatch it again?</p>
  <p>BTW, I am using database as the queue driver.</p>