azazqadir azazqadir - 29 days ago
1704 0

Here is how you can create and schedule cron job in Laravel easily using custom artisan command and command scheduler in Laravel.

PHP

Create and Schedule Cron Jobs Easily with Laravel

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class HourlyUpdate extends Command

{

   /**

    * The name and signature of the console command.

    *

    * @var string

    */

   protected $signature = 'command:name';



   /**

    * The console command description.

    *

    * @var string

    */

   protected $description = 'Command description';



   /**

    * Create a new command instance.

    *

    * @return void

    */

   public function __construct()

   {

       parent::__construct();

   }



   /**

    * Execute the console command.

    *

    * @return mixed

    */

   public function handle()

   {

       //

   }

}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download