feat: complete booking
This commit is contained in:
+35
-61
@@ -1,79 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\BookingStatus;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Booking
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $flight_id
|
||||
* @property int $toure_date_id
|
||||
* @property int $adult_count
|
||||
* @property int $child_count
|
||||
* @property int $total_price
|
||||
* @property string $tracking_code
|
||||
* @property int $status
|
||||
* @property Carbon $created_ar
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Flight $flights
|
||||
* @property TourDate $tour_date
|
||||
* @property User $user
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Booking extends Model
|
||||
{
|
||||
protected $table = 'bookings';
|
||||
public $timestamps = false;
|
||||
protected $table = 'bookings';
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'flight_id' => 'int',
|
||||
'toure_date_id' => 'int',
|
||||
'adult_count' => 'int',
|
||||
'child_count' => 'int',
|
||||
'total_price' => 'int',
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'flight_id' => 'int',
|
||||
'tour_id' => 'int',
|
||||
'adult_count' => 'int',
|
||||
'child_count' => 'int',
|
||||
'total_price' => 'int',
|
||||
'status' => BookingStatus::class,
|
||||
'created_at' => 'datetime'
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'flight_id',
|
||||
'toure_date_id',
|
||||
'adult_count',
|
||||
'child_count',
|
||||
'total_price',
|
||||
'tracking_code',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'flight_id',
|
||||
'tour_id',
|
||||
'adult_count',
|
||||
'child_count',
|
||||
'total_price',
|
||||
'tracking_code',
|
||||
'status',
|
||||
'created_at',
|
||||
];
|
||||
|
||||
public function flight()
|
||||
{
|
||||
return $this->belongsTo(Flight::class);
|
||||
}
|
||||
public function flight()
|
||||
{
|
||||
return $this->belongsTo(Flight::class);
|
||||
}
|
||||
|
||||
public function tour_date()
|
||||
{
|
||||
return $this->belongsTo(TourDate::class, 'toure_date_id');
|
||||
}
|
||||
public function tour()
|
||||
{
|
||||
return $this->belongsTo(Tour::class, 'tour_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function passengers()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user