Basic signup for events
This commit is contained in:
@@ -7,12 +7,14 @@ use App\Casts\AmountCast;
|
||||
use App\Enumerations\EatingHabit;
|
||||
use App\Enumerations\ParticipationFeeType;
|
||||
use App\RelationModels\EventParticipationFee;
|
||||
use App\Resources\EventResource;
|
||||
use App\Scopes\CommonModel;
|
||||
use App\Scopes\InstancedModel;
|
||||
use DateTime;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* @property string $tenant
|
||||
@@ -53,6 +55,7 @@ class Event extends InstancedModel
|
||||
'tenant',
|
||||
'cost_unit_id',
|
||||
'name',
|
||||
'identifier',
|
||||
'location',
|
||||
'postal_code',
|
||||
'email',
|
||||
@@ -169,4 +172,5 @@ class Event extends InstancedModel
|
||||
public function participants() : hasMany {
|
||||
return $this->hasMany(EventParticipant::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ class EventParticipant extends InstancedModel
|
||||
'tenant',
|
||||
'event_id',
|
||||
'user_id',
|
||||
'identifier',
|
||||
|
||||
'firstname',
|
||||
'lastname',
|
||||
@@ -42,6 +43,8 @@ class EventParticipant extends InstancedModel
|
||||
|
||||
'allergies',
|
||||
'intolerances',
|
||||
'medications',
|
||||
'tetanus_vaccination',
|
||||
'eating_habits',
|
||||
'swimming_permission',
|
||||
'first_aid_permission',
|
||||
@@ -60,12 +63,14 @@ class EventParticipant extends InstancedModel
|
||||
'notes',
|
||||
'amount',
|
||||
'amount_paid',
|
||||
'payment_purpose',
|
||||
'efz_status',
|
||||
'unregistered_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'birthday' => 'datetime',
|
||||
'tetanus_vaccination' => 'datetime',
|
||||
'arrival_date' => 'datetime',
|
||||
'departure_date' => 'datetime',
|
||||
'unregistered_at' => 'datetime',
|
||||
@@ -131,5 +136,21 @@ class EventParticipant extends InstancedModel
|
||||
return $this->belongsTo(EfzStatus::class, 'efz_status', 'slug');
|
||||
}
|
||||
|
||||
public function getOfficialName() : string {
|
||||
return sprintf('%1$s %2$s', $this->firstname, $this->lastname);
|
||||
}
|
||||
|
||||
public function getFullname() : string {
|
||||
return sprintf('%1$1s %2$s %3$s',
|
||||
$this->firstname,
|
||||
$this->lastname,
|
||||
$this->nickname !== null ? '(' . $this->nickname . ')' : '',
|
||||
)
|
||||
|>trim(...);
|
||||
}
|
||||
|
||||
public function getNicename() : string {
|
||||
return $this->nickname ?? $this->firstname;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ class User extends Authenticatable
|
||||
'medications',
|
||||
'allergies',
|
||||
'intolerances',
|
||||
'tetanus_vaccination',
|
||||
'eating_habits',
|
||||
'swimming_permission',
|
||||
'first_aid_permission',
|
||||
|
||||
Reference in New Issue
Block a user