Files
exchange-2.0/app/Classes/Modules/Milestones/Services/CheckIfMilestoneProgressExists.php
T
2023-07-17 21:29:19 +08:00

28 lines
611 B
PHP

<?php
namespace App\Classes\Modules\Milestones\Services;
use App\Models\MilestoneProgress;
class CheckIfMilestoneProgressExists
{
/** @var MilestoneProgress */
private $repository;
/**
* CheckIfMilestoneProgressExists constructor.
* @param MilestoneProgress $repository
*/
public function __construct(MilestoneProgress $repository)
{
$this->repository = $repository;
}
public function execute(int $user_id, int $milestone_id): bool {
return $this->repository->where('user_id', $user_id)->where('milestone_id', $milestone_id)->exists();
}
}