DEV Community

loading...

How I can execute a command at a specific date and time in laravel 5.8?

pcmagas profile image Dimitrios Desyllas ・1 min read

As I ask bellow:

Ι need to be able rto scedule a command to run in specific date and time.

I have the following doomday nuking command:

<?php
namespace App\Console\Commands;

class DommdayCommand extends Command
{

  protected $signature='nuke:country {commander} {country} ';
  protected $description=

  public function handle()
  {
    $dictator= $this->argument('commander');
    $country= $this->argument('country');

    $this->output("Nuking the {$country} from

I try to schedule the execution some command on a specific date and time only once.

But laravel's options allow me to schedule only at a specific frequency over and over again, which I find it wastefull for only once command executon.

So can you offer me an idea how I can schedule a command execution only once at a specific date and time?

Discussion (0)

Forem Open with the Forem app