81 lines
1.4 KiB
PHP
81 lines
1.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Booking
|
|
*
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int $flight_id
|
|
* @property int $tour_date_id
|
|
* @property int $adult_count
|
|
* @property int $child_count
|
|
* @property int $total_price
|
|
* @property string $tracking_code
|
|
* @property Carbon $created_at
|
|
* @property int $status
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property Booking $booking
|
|
* @property Flight $flight
|
|
* @property TourDate $tourDate
|
|
* @property Collection|Booking[] $bookings
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Booking extends Model
|
|
{
|
|
protected $table = 'bookings';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'user_id' => 'int',
|
|
'flight_id' => 'int',
|
|
'tour_date_id' => 'int',
|
|
'adult_count' => 'int',
|
|
'child_count' => 'int',
|
|
'total_price' => 'int',
|
|
'status' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'flight_id',
|
|
'tour_date_id',
|
|
'adult_count',
|
|
'child_count',
|
|
'total_price',
|
|
'tracking_code',
|
|
'status'
|
|
];
|
|
|
|
public function booking()
|
|
{
|
|
return $this->belongsTo(Booking::class, 'user_id');
|
|
}
|
|
|
|
public function flight()
|
|
{
|
|
return $this->belongsTo(Flight::class);
|
|
}
|
|
|
|
public function tourDate()
|
|
{
|
|
return $this->belongsTo(TourDate::class);
|
|
}
|
|
|
|
public function bookings()
|
|
{
|
|
return $this->hasMany(Booking::class, 'user_id');
|
|
}
|
|
}
|