ldc-legaulois/app/Console/Commands/RemoveOldOrderXmlFilesCommand.php
Jérémy Munsch 9b4af94e73
Closes #39 Send Orders as Email to arcadia and keep generated files
-  clean files after one month
- Dispatch emails as database jobs (retry on fail)
- add command to trigger cleanup of old xml files
2023-09-18 18:17:00 +02:00

37 lines
797 B
PHP

<?php
namespace App\Console\Commands;
use App\Jobs\Arcadia\RemoveOldOrderXmlFiles;
use Illuminate\Console\Command;
class RemoveOldOrderXmlFilesCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'xml:removeOldOrders';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Run the RemoveOldOrderXmlFiles manually';
/**
* Execute the console command.
*
* @return integer
*/
public function handle(): int
{
$this->info('Running the Job, this could take some time.');
$job = new RemoveOldOrderXmlFiles();
$job->handle();
$this->info('Job completed');
return 0;
}
}