102 lines
1.9 KiB
PHP
102 lines
1.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Flight
|
|
*
|
|
* @property int $id
|
|
* @property string $flight_number
|
|
* @property int $airline_id
|
|
* @property int $origin_airports_id
|
|
* @property int $destination_airports_id
|
|
* @property Carbon $start_time
|
|
* @property Carbon $end_time
|
|
* @property int $price
|
|
* @property int $capacity
|
|
* @property int $status
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property Airline $airline
|
|
* @property Airport $airport
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Flight extends Model
|
|
{
|
|
/**
|
|
* @var mixed|string
|
|
*/
|
|
public mixed $start_date_fa;
|
|
/**
|
|
* @var int|mixed
|
|
*/
|
|
public mixed $duration_hours;
|
|
/**
|
|
* @var int|mixed
|
|
*/
|
|
public mixed $duration_minutes;
|
|
/**
|
|
* @var mixed|string
|
|
*/
|
|
public mixed $start_time_fa;
|
|
/**
|
|
* @var mixed|string
|
|
*/
|
|
public mixed $end_time_fa;
|
|
/**
|
|
* @var mixed|string
|
|
*/
|
|
public mixed $full_date_fa;
|
|
/**
|
|
* @var mixed|string
|
|
*/
|
|
public mixed $end_date_fa;
|
|
protected $table = 'flights';
|
|
|
|
protected $casts = [
|
|
'airline_id' => 'int',
|
|
'origin_airports_id' => 'int',
|
|
'destination_airports_id' => 'int',
|
|
'start_time' => 'datetime',
|
|
'end_time' => 'datetime',
|
|
'price' => 'int',
|
|
'capacity' => 'int',
|
|
'status' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'flight_number',
|
|
'airline_id',
|
|
'origin_airports_id',
|
|
'destination_airports_id',
|
|
'start_time',
|
|
'end_time',
|
|
'price',
|
|
'capacity',
|
|
'status'
|
|
];
|
|
|
|
public function airline()
|
|
{
|
|
return $this->belongsTo(Airline::class);
|
|
}
|
|
|
|
public function airport()
|
|
{
|
|
return $this->belongsTo(Airport::class, 'origin_airports_id');
|
|
}
|
|
public function destinationAirport()
|
|
{
|
|
return $this->belongsTo(Airport::class, 'destination_airports_id');
|
|
}
|
|
}
|