fix:edit booking and booking passengers model
This commit is contained in:
@@ -6,12 +6,13 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\PassengerType;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingPassenger
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property string $first_name
|
||||
@@ -27,12 +28,14 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class BookingPassenger extends Model
|
||||
{
|
||||
protected $table = 'booking_passengers';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'passenger_type' => 'int',
|
||||
'birth_date' => 'datetime'
|
||||
'birth_date' => 'datetime',
|
||||
'passenger_type' => PassengerType::class,
|
||||
'created_ar' => 'datetime'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
@@ -41,6 +44,12 @@ class BookingPassenger extends Model
|
||||
'last_name',
|
||||
'national_code',
|
||||
'passenger_type',
|
||||
'birth_date'
|
||||
'birth_date',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user