choose who can see their referral URL
This commit is contained in:
parent
c0e0c99a1b
commit
7ed402a227
|
@ -39,6 +39,7 @@ class Misc
|
||||||
'mailfromname' => 'nullable|string',
|
'mailfromname' => 'nullable|string',
|
||||||
'enable_referral' => 'nullable|string',
|
'enable_referral' => 'nullable|string',
|
||||||
'referral_reward' => 'nullable|numeric',
|
'referral_reward' => 'nullable|numeric',
|
||||||
|
'referral_allowed' => 'nullable|string',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
|
@ -72,7 +73,8 @@ class Misc
|
||||||
"SETTINGS::MAIL:FROM_ADDRESS" => "mailfromadress",
|
"SETTINGS::MAIL:FROM_ADDRESS" => "mailfromadress",
|
||||||
"SETTINGS::MAIL:FROM_NAME" => "mailfromname",
|
"SETTINGS::MAIL:FROM_NAME" => "mailfromname",
|
||||||
"SETTINGS::REFERRAL::ENABLED" => "enable_referral",
|
"SETTINGS::REFERRAL::ENABLED" => "enable_referral",
|
||||||
"SETTINGS::REFERRAL::REWARD" => "referral_reward"
|
"SETTINGS::REFERRAL::REWARD" => "referral_reward",
|
||||||
|
"SETTINGS::REFERRAL::ALLOWED" => "referral_allowed"
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -479,5 +479,12 @@ class SettingsSeeder extends Seeder
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
'description' => 'Credit reward a user should receive when a user registers with his referral code'
|
'description' => 'Credit reward a user should receive when a user registers with his referral code'
|
||||||
]);
|
]);
|
||||||
|
Settings::firstOrCreate([
|
||||||
|
'key' => 'SETTINGS::REFERRAL::ALLOWED',
|
||||||
|
], [
|
||||||
|
'value' =>"client",
|
||||||
|
'type' => 'string',
|
||||||
|
'description' => 'Who should be allowed to to use the referral code. all/client'
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,6 +210,19 @@
|
||||||
class="form-control @error('referral_reward') is-invalid @enderror">
|
class="form-control @error('referral_reward') is-invalid @enderror">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="custom-control mb-3 p-0">
|
||||||
|
<label for="mailservice">{{ __('Allowed') }}:
|
||||||
|
<i data-toggle="popover" data-trigger="hover"
|
||||||
|
data-content="{{ __('Who is allowed to see their referral-URL') }}" class="fas fa-info-circle"></i>
|
||||||
|
</label>
|
||||||
|
<select id="referral_allowed" style="width:100%" class="custom-select" name="referral_allowed" required
|
||||||
|
autocomplete="off" @error('referral_allowed') is-invalid @enderror>
|
||||||
|
<option value="everyone" @if (config('SETTINGS::REFERRAL::ALLOWED') == "everyone") selected
|
||||||
|
@endif>{{ __("Everyone") }}</option>
|
||||||
|
<option value="client" @if (config('SETTINGS::REFERRAL::ALLOWED') == "client") selected
|
||||||
|
@endif>{{ __("Clients") }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -100,9 +100,9 @@
|
||||||
class="fa fa-coins mr-2"></i>{{ $user->Credits() }}</span>
|
class="fa fa-coins mr-2"></i>{{ $user->Credits() }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if(config('SETTINGS::REFERRAL::ENABLED') == "true")
|
||||||
|
@if((config('SETTINGS::REFERRAL::ALLOWED') == "client" && $user->role != "member") || config('SETTINGS::REFERRAL::ALLOWED') == "everyone")
|
||||||
<div class="mt-1">
|
<div class="mt-1">
|
||||||
@if(config('SETTINGS::REFERRAL::ENABLED') == "true" && $user->role != "member")
|
|
||||||
<span class="badge badge-success"><i
|
<span class="badge badge-success"><i
|
||||||
class="fa fa-user-check mr-2"></i>
|
class="fa fa-user-check mr-2"></i>
|
||||||
{{_("Referral URL")}} : {{route("register")}}?ref={{$user->referral_code}}</span>
|
{{_("Referral URL")}} : {{route("register")}}?ref={{$user->referral_code}}</span>
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
{{_("Make a purchase to reveal your referral-URL")}}</span>
|
{{_("Make a purchase to reveal your referral-URL")}}</span>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue