예제 #1
0
 /**
  * Create a new job and save it to the specified queue.
  *
  * @param string $queue The name of the queue to place the job in.
  * @param string $class The name of the class that contains the code to execute the job.
  * @param array $args Any optional arguments that should be passed when the job is executed.
  * @param boolean $trackStatus Set to true to be able to monitor the status of a job.
  *
  * @return string
  */
 public static function enqueue($queue, $class, $args = null, $trackStatus = false)
 {
     $result = Job::create($queue, $class, $args, $trackStatus);
     if ($result) {
         Event::trigger('afterEnqueue', ['class' => $class, 'args' => $args, 'queue' => $queue]);
     }
     return $result;
 }