mein-sterntours/app/Models/Participant.php
2020-04-15 12:11:42 +02:00

72 lines
2.2 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)
* @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'
];
protected $dates = [
'participant_birthdate'
];
protected $fillable = [
'booking_id',
'participant_name',
'participant_firstname',
'participant_birthdate',
'participant_salutation_id',
'participant_child'
];
public function booking()
{
return $this->belongsTo(Booking::class);
}
public function salutation()
{
return $this->belongsTo(Salutation::class, 'participant_salutation_id');
}
}