Files
bogazici-api/app/Actions/Lead/DeleteLeadAction.php
2026-03-27 10:41:54 +03:00

22 lines
436 B
PHP

<?php
namespace App\Actions\Lead;
use App\Events\ModelChanged;
use App\Models\Lead;
use App\Repositories\Contracts\LeadRepositoryInterface;
final class DeleteLeadAction
{
public function __construct(private LeadRepositoryInterface $repository) {}
public function execute(Lead $lead): bool
{
$this->repository->delete($lead);
ModelChanged::dispatch(Lead::class, 'deleted');
return true;
}
}