mirror of
https://github.com/ConjureETS/Interface-Admin.git
synced 2026-03-24 04:21:06 +00:00
Correction Inscription
This commit is contained in:
parent
805846529d
commit
3fb5818dbb
@ -39,6 +39,8 @@ class InscriptionController extends Controller
|
||||
|
||||
$member = $this->create($request->all());
|
||||
|
||||
(new MailController())->sendInscriptionMail($member);
|
||||
|
||||
return view('inscription')->with([
|
||||
'member' => $member
|
||||
]);
|
||||
@ -64,7 +66,7 @@ class InscriptionController extends Controller
|
||||
'email' => $data['email'],
|
||||
'universal_code' => $data['universal_code'],
|
||||
'start_semester' => Member::getSemesterLetter().date("Y"),
|
||||
'activity' => Member::ACTIVITY[0],
|
||||
'activity' => 1,
|
||||
'phone' => $data['phone'],
|
||||
'program_id' => $data['program_id']
|
||||
]);
|
||||
|
||||
@ -26,7 +26,7 @@ class PhoneRule implements Rule
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
if(!empty($value))
|
||||
return preg_match('/^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$/i', $value) && strlen($value) >= 10;
|
||||
return preg_match('/(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?/i', $value) && strlen($value) >= 10;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
19
app/User.php
19
app/User.php
@ -36,27 +36,8 @@ class User extends Authenticatable
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'email', 'first_name', 'last_name'
|
||||
];
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo("App\Models\Member");
|
||||
}
|
||||
|
||||
public function getEmailAttribute()
|
||||
{
|
||||
return $this->member()->email;
|
||||
}
|
||||
|
||||
public function getFirstNameAttribute()
|
||||
{
|
||||
return $this->member()->first_name;
|
||||
}
|
||||
|
||||
public function getLastNameAttribute()
|
||||
{
|
||||
return $this->member()->last_name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,14 +90,14 @@
|
||||
<label for="program" class="col-md-4 col-form-label text-md-right">{{ __('general.program') }}</label>
|
||||
|
||||
<div class="col-md-8">
|
||||
<select id="program" class="form-control @error('program') is-invalid @enderror" name="program" value="{{ old('program') }}" required autocomplete="program">
|
||||
<select id="program_id" class="form-control @error('program_id') is-invalid @enderror" name="program_id" required autocomplete="program_id">
|
||||
<option>{{ __('general.choose-option') }}</option>
|
||||
@foreach($programs as $program)
|
||||
<option value="{{ $program->id }}">{{ $program->name }}</option>
|
||||
<option value="{{ $program->id }}" {{ old('program_id') == $program->id ? "selected" : "" }}>{{ $program->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@error('program')
|
||||
@error('program_id')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@ -109,14 +109,14 @@
|
||||
<label for="communication_method" class="col-md-4 col-form-label text-md-right">{{ __('general.communication-method') }}</label>
|
||||
|
||||
<div class="col-md-8">
|
||||
<select id="communication_method" class="form-control @error('communication_method') is-invalid @enderror" name="communication_method" value="{{ old('communication_method') }}" required autocomplete="communication_method">
|
||||
<select id="communication_method_id" class="form-control @error('communication_method_id') is-invalid @enderror" name="communication_method_id" required autocomplete="communication_method_id">
|
||||
<option>{{ __('general.choose-option') }}</option>
|
||||
@foreach($communicationMethods as $communicationMethod)
|
||||
<option value="{{ $communicationMethod->id }}">{{ $communicationMethod->name }}</option>
|
||||
<option value="{{ $communicationMethod->id }}" {{ old('communication_method_id') == $communicationMethod->id ? "selected" : "" }}>{{ $communicationMethod->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@error('communication_method')
|
||||
@error('communication_method_id')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
@endforeach
|
||||
</ul>
|
||||
<p>{{ __('mails.laboratory-deadline', ['deadline' => date("d-m-Y", strtotime("+3 weeks"))]) }}</p>
|
||||
<p>{{ __('mails.laboratory-return-instruction') }}</p>
|
||||
<p>{!! __('mails.laboratory-return-instruction') !!}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user