90 lines
2.9 KiB
PHP
90 lines
2.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Participant
|
|
*
|
|
* @property int $id
|
|
* @property int $booking_id
|
|
* @property string $participant_name
|
|
* @property string $participant_firstname
|
|
* @property Carbon $participant_birthdate
|
|
* @property int $participant_salutation_id
|
|
* @property bool $participant_child
|
|
* @property Booking $booking
|
|
* @property Salutation $salutation
|
|
* @package App\Models
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereBookingId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantBirthdate($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantChild($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantFirstname($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantName($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantSalutationId($value)
|
|
* @property int|null $nationality_id
|
|
* @property-read \App\Models\TravelNationality|null $travel_nationality
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereNationalityId($value)
|
|
* @property bool|null $participant_pass
|
|
* @property bool|null $participant_storno
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Participant whereParticipantPass($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Participant whereParticipantStorno($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class Participant extends Model
|
|
{
|
|
protected $connection = 'mysql';
|
|
|
|
protected $table = 'participant';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'booking_id' => 'int',
|
|
'participant_salutation_id' => 'int',
|
|
'participant_child' => 'bool',
|
|
'participant_pass' => 'bool',
|
|
'participant_storno' => 'bool'
|
|
|
|
];
|
|
|
|
protected $dates = [
|
|
'participant_birthdate'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'booking_id',
|
|
'participant_name',
|
|
'participant_firstname',
|
|
'participant_birthdate',
|
|
'participant_salutation_id',
|
|
'participant_child',
|
|
'nationality_id',
|
|
'participant_pass',
|
|
'participant_storno'
|
|
];
|
|
|
|
public function booking()
|
|
{
|
|
return $this->belongsTo(Booking::class);
|
|
}
|
|
|
|
public function salutation()
|
|
{
|
|
return $this->belongsTo(Salutation::class, 'participant_salutation_id');
|
|
}
|
|
|
|
public function travel_nationality()
|
|
{
|
|
return $this->belongsTo(TravelNationality::class, 'nationality_id');
|
|
}
|
|
}
|