Custom Ref ID
This commit is contained in:
parent
4e63d5348f
commit
d197a2e251
2 changed files with 19 additions and 1 deletions
|
@ -123,8 +123,15 @@ class UserController extends Controller
|
|||
"credits" => "required|numeric|min:0|max:99999999",
|
||||
"server_limit" => "required|numeric|min:0|max:1000000",
|
||||
"role" => Rule::in(['admin', 'mod', 'client', 'member']),
|
||||
"referral_code" => "required|string|min:2|max:32",
|
||||
]);
|
||||
|
||||
if (User::where('referral_code', '=', $request->input('referral_code'))->exists()) {
|
||||
throw ValidationException::withMessages([
|
||||
'referral_code' => [__("Another User with this Referral-Code already exists!")]
|
||||
]);
|
||||
}
|
||||
|
||||
if (isset($this->pterodactyl->getUser($request->input('pterodactyl_id'))['errors'])) {
|
||||
throw ValidationException::withMessages([
|
||||
'pterodactyl_id' => [__("User does not exists on pterodactyl's panel")]
|
||||
|
|
|
@ -114,12 +114,23 @@
|
|||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name">{{__('Referral-Code')}}</label>
|
||||
<input value="{{$user->referral_code}}" id="referral_code" name="referral_code" type="text"
|
||||
class="form-control @error('referral_code') is-invalid @enderror" required="required">
|
||||
@error('referral_code')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
@error('role')
|
||||
<div class="text-danger">
|
||||
{{$message}}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right">
|
||||
<button type="submit" class="btn btn-primary">{{__('Submit')}}</button>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue