DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

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

As I ask bellow:

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

I have the following doomsday nuking command:

<?php
namespace App\Console\Commands;

class DommdayCommand extends Command
{

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

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

    $this->output("Nuking the

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)