title: How to put in queue in laravel 5.4
body: <p>I need to send email using  jobs.</p>
  
  <p>First step: I create tables using migrations(tables: jobs and failed_jobs).</p>
  
  <p>Second step: I create class with method hendle using console command:</p>
  
  <p><code>php artisan make:job SendForgotPasswordEmail</code></p>
  
  <p>Thirt step: in method hendle() I put </p>
  
  <pre><code>Mail::to($this-&gt;user)-&gt;send(new RefreshPassword($this-&gt;user));
  </code></pre>
  
  <p>Fourth step: in my controller:</p>
  
  <pre><code>dispatch((new SendForgotPasswordEmail($user))-&gt;delay(Carbon::now()-&gt;addMinutes(2)));
  </code></pre>
  
  <p>Fifth step:</p>
  
  <pre><code>php artisan queue:work
  </code></pre>
  
  <p>My queue.php file: </p>
  
  <pre><code>'default' =&gt; env('QUEUE_DRIVER', 'sync'),
  
  'connections' =&gt; [
  
      'sync' =&gt; [
          'driver' =&gt; 'sync',
      ],
  
      'database' =&gt; [
          'driver' =&gt; 'database',
          'table' =&gt; 'jobs',
          'queue' =&gt; 'default',
          'retry_after' =&gt; 90,
      ],
  
      'beanstalkd' =&gt; [
          'driver' =&gt; 'beanstalkd',
          'host' =&gt; 'localhost',
          'queue' =&gt; 'default',
          'retry_after' =&gt; 90,
      ],
  
      'sqs' =&gt; [
          'driver' =&gt; 'sqs',
          'key' =&gt; 'your-public-key',
          'secret' =&gt; 'your-secret-key',
          'prefix' =&gt; 'https://sqs.us-east-1.amazonaws.com/your-account-id',
          'queue' =&gt; 'your-queue-name',
          'region' =&gt; 'us-east-1',
      ],
  
      'redis' =&gt; [
          'driver' =&gt; 'redis',
          'connection' =&gt; 'default',
          'queue' =&gt; 'default',
          'retry_after' =&gt; 90,
      ],
  
  ],
  
  'failed' =&gt; [
      'database' =&gt; env('DB_CONNECTION', 'mysql'),
      'table' =&gt; 'failed_jobs',
  ],
  </code></pre>
  
  <p>And job:</p>
  
  <pre><code> public function __construct($user)
  {
      $this-&gt;user = $user;
  }
  
  /**
   * Execute the job.
   *
   * @return void
   */
  public function handle()
  {
      Mail::to($this-&gt;user)-&gt;send(new RefreshPassword($this-&gt;user));
  }
  </code></pre>
  
  <p>Then I sent email. But email sent momently, although in method delay I put 2 minutes. Thank's.</p>