mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-26 16:04:05 +00:00
30ed77f304
# Conflicts: # resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue # routes/api.php
30 lines
635 B
PHP
30 lines
635 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Affiliate\Services;
|
|
|
|
use App\Models\KeyValuePair;
|
|
|
|
class GetsAffiliateSettings
|
|
{
|
|
const SETTING_KEY = 'affiliate_code_binding_days';
|
|
const DEFAULT_VALUE = 30;
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function execute(): array
|
|
{
|
|
$keyValuePair = KeyValuePair::where('key', self::SETTING_KEY)
|
|
->whereNull('owner_type')
|
|
->whereNull('owner_id')
|
|
->first();
|
|
|
|
$codeBindingDays = $keyValuePair ? (int) $keyValuePair->value : self::DEFAULT_VALUE;
|
|
|
|
return [
|
|
'code_binding_days' => $codeBindingDays
|
|
];
|
|
}
|
|
}
|
|
|