This commit is contained in:
2026-08-15 13:29:00 -07:00
parent 649feeba63
commit 793dc85e44
70 changed files with 12639 additions and 0 deletions
+89
View File
@@ -0,0 +1,89 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Flight
*
* @property int $id
* @property string $title
* @property int|null $file_id
* @property int $airline_id
* @property int $flight_type
* @property Carbon $departure_time
* @property int $departure_airport_id
* @property int $arrival_airport_id
* @property float $price
* @property string $summary
* @property int $capacity
* @property string $description
* @property int $status
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property Airline $airline
* @property File|null $file
* @property Airport $airport
* @property Collection|Booking[] $bookings
*
* @package App\Models
*/
class Flight extends Model
{
protected $table = 'flights';
protected $casts = [
'file_id' => 'int',
'airline_id' => 'int',
'flight_type' => 'int',
'departure_time' => 'datetime',
'departure_airport_id' => 'int',
'arrival_airport_id' => 'int',
'price' => 'float',
'capacity' => 'int',
'status' => 'int'
];
protected $fillable = [
'title',
'file_id',
'airline_id',
'flight_type',
'departure_time',
'departure_airport_id',
'arrival_airport_id',
'price',
'summary',
'capacity',
'description',
'status'
];
public function airline()
{
return $this->belongsTo(Airline::class);
}
public function file()
{
return $this->belongsTo(File::class);
}
public function airport()
{
return $this->belongsTo(Airport::class, 'departure_airport_id');
}
public function bookings()
{
return $this->hasMany(Booking::class);
}
}