Files
admin/app/Console/Commands/NotifyExpiringItems.php
Husanjonazamov e0f1989655 classify admin
2026-02-24 12:52:01 +05:00

33 lines
823 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Services\ExpiringItemService;
class NotifyExpiringItems extends Command
{
protected $signature = 'notify:expiring-items';
protected $description = 'Send notifications for items expiring in 2 days.';
protected $expiringItemService;
/**
* Inject the ExpiringItemService
*/
public function __construct(ExpiringItemService $expiringItemService)
{
parent::__construct();
$this->expiringItemService = $expiringItemService;
}
/**
* Execute the console command.
*/
public function handle()
{
$this->expiringItemService->notifyExpiringItems();
$this->info('Expiring Advertisement notifications sent successfully.');
}
}