ldc-legaulois/app/Console/Commands/PurgeNotifications.php
Jérémy Munsch c5e3a834fa phpcbf fix
2021-09-15 14:27:41 +02:00

38 lines
879 B
PHP

<?php
namespace App\Console\Commands;
use App\Jobs\PurgeNotifications as JobsPurgeNotifications;
use Illuminate\Console\Command;
//phpcs:disable Generic.Files.LineLength.TooLong
class PurgeNotifications extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'notifications:purge';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Purge the notifications table where the created_at date of a notification is older than 30 days';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$this->info('Running the Job, this could take some time.');
$job = new JobsPurgeNotifications();
$job->handle();
$this->info('Job completed');
}
}