title: Schedule cron job laravel
body: <p>I will like to know how to schedule a cron job to run everyday at 00:01.</p>
  
  <p>I have created <code>JOB</code> in <code>App/Jobs</code> folder </p>
  
  <pre><code>&lt;?php
  namespace App\Jobs;
  use App\Models\Result;
  use App\Jobs\Job;
  use Illuminate\Contracts\Bus\SelfHandling;
  use DB;
  
  set_time_limit(0);
  
  class UpdateActive extends Job implements SelfHandling
  {
      public static function ActiveUpdate()
      {
          Result::update(['draw_id' =&gt; 1, 
                          'isactive' =&gt; 0
                         ]);
       }
  
     public static function downGrade()
     {
     try {
          UserRole::update(['permission' =&gt; 1,
                           'isactive' =&gt; 2    
          ]);
     } catch (QueryException $e ) {
       //handle error
     }
     }
  
     public static function handle() 
     {
       self::ActiveUpdate();
       self::downGrade();
     }
   }
  </code></pre>
  
  <p>in App/Console/Kernel.php I have added this link to the <code>schedule</code> method</p>
  
  <pre><code>protected function schedule(Schedule $schedule)
      {
          /*$schedule-&gt;command('inspire')
                   -&gt;hourly(); */
          $schedule-&gt;call(function () {
              $check_draw = \App\Jobs\UpdateActive::ActiveUpdate();
  
          })-&gt;everyMinute();
      }
  </code></pre>
  
  <p><strong>Please note I have used everyMinute for test purpose</strong></p>
  
  <p>In <code>crontab -e</code> I then added </p>
  
  <p><code>* * * * * php /home/vagrant/Code/projects/artisan schedule:run 1&gt;&gt; /dev/null 2&gt;&amp;1</code></p>
  
  <p>but the schedule doesn't seem to run i think because when i check my <code>results</code> table the <code>isactive</code> field hasn't changed.</p>
  
  <p>I am wondering where I am going wrong please. If anyone has done this in L5. What am I missing?</p>