My command on godaddy server for Cron job is below.
/usr/local/bin/php -q public_html/Publisher/artisan schedule:run > /dev/null 2>&1
My app\Console\Kernel.php is here
class Kernel extends ConsoleKernel
{
    protected $commands = [
        'App\Console\Commands\ytzAPI',
        'App\Console\Commands\Invoice',
    ];
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('api:ytz')->everyMinute();
        $schedule->command('api:invoice')->daily();
    }
    protected function commands()
    {
        require base_path('routes/console.php');
    }
}
My Question
I want to run one command after every minute and another command on daily basis.
$schedule->command('api:ytz')->everyMinute();
$schedule->command('api:invoice')->daily();
Cron job is running after each minute and is running $schedule->command('api:invoice')->daily(); also. How could I differentiate everyMinute command from daily
via Chebli Mohamed
 
Aucun commentaire:
Enregistrer un commentaire