title: How to fail a job and make it skip next attempts in the queue in Laravel?
body: <p>I'm writing a simple queue.</p>
  
  <pre><code>namespace App\Jobs;
  
  use App\SomeMessageSender;
  
  class MessageJob extends Job
  {
      protected $to;
      protected $text;
  
      /**
       * Create a new job instance.
       *
       * @return void
       */
      public function __construct($to, $text)
      {
          $this-&gt;to = $to;
          $this-&gt;text = $text;
      }
  
      /**
       * Execute the job.
       *
       * @return void
       */
      public function handle(SomeMessageSender $sender)
      {
      if ($sender-&gt;paramsAreValid($this-&gt;to, $this-&gt;text) {
              $sender-&gt;sendMessage($this-&gt;to, $this-&gt;text);
          }
      else {
          // Fail without being attempted any further
              throw new Exception ('The message params are not valid');
          }
      }
  }
  </code></pre>
  
  <p>If the params are not valid the above code will throw an exception which causes the job to fail but if it still has attempts left, it will be tried again. Instead I want to force this to <strong>fail instantly and never attempt again</strong>.</p>
  
  <p>How can I do this?</p>