File: /var/www/vhost/disk-apps/qas.sports-crowd.com/app/Core/Academy/Application/ParameterService.php
<?php
declare(strict_types=1);
namespace App\Core\Academy\Application;
use App\AcademyParameter;
use App\Core\Academy\Domain\ValueObjects\PaymentScheduleEnum;
class ParameterService
{
public static function get(string $key, ?string $academy_type = 'children'): ?string
{
return AcademyParameter::where('key', $key)->where('type_academy', $academy_type)->first()->value ?? null;
}
public function paymentsByDate()
{
$paymentSchedule = $this->get('payment_schedule');
return $paymentSchedule == PaymentScheduleEnum::PAYMENTS_BY_DATE;
}
public function paymentActivationDateInApp()
{
$paymentActivationDateInApp = $this->get('payment_activation_date_in_app');
return $paymentActivationDateInApp ? intval($paymentActivationDateInApp) : 0;
}
}