mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
28 lines
553 B
PHP
28 lines
553 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Vouchers\Services;
|
|
|
|
use App\Models\VoucherCampaign;
|
|
|
|
class CheckIfVoucherCampaignExists
|
|
{
|
|
|
|
/** @var VoucherCampaign */
|
|
private $repository;
|
|
|
|
|
|
/**
|
|
* CheckIfVoucherCampaignExists constructor.
|
|
* @param VoucherCampaign $repository
|
|
*/
|
|
public function __construct(VoucherCampaign $repository)
|
|
{
|
|
$this->repository = $repository;
|
|
}
|
|
|
|
public function execute(string $campaignId): bool {
|
|
return $this->repository->where('campaign_id', $campaignId)->exists();
|
|
}
|
|
|
|
}
|