68 lines
1.2 KiB
PHP
68 lines
1.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Booking
|
|
*
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int|null $flight_id
|
|
* @property int|null $tour_departure_id
|
|
* @property int $total_price
|
|
* @property int $status
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
* @property string $booking_type
|
|
*
|
|
* @property User $user
|
|
* @property TourDeparture|null $tourDeparture
|
|
* @property Flight|null $flight
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Booking extends Model
|
|
{
|
|
protected $table = 'booking';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'user_id' => 'int',
|
|
'flight_id' => 'int',
|
|
'tour_departure_id' => 'int',
|
|
'total_price' => 'int',
|
|
'status' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'flight_id',
|
|
'tour_departure_id',
|
|
'total_price',
|
|
'status',
|
|
'booking_type'
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function tourDeparture()
|
|
{
|
|
return $this->belongsTo(TourDeparture::class);
|
|
}
|
|
|
|
public function flight()
|
|
{
|
|
return $this->belongsTo(Flight::class);
|
|
}
|
|
}
|