fix:change models problems and routes

This commit is contained in:
2026-08-16 16:55:08 +03:30
parent 05bec33988
commit d0bb8e5413
6 changed files with 161 additions and 259 deletions
+12 -2
View File
@@ -14,10 +14,11 @@ use Illuminate\Database\Eloquent\Model;
*
* @property int $id
* @property string $name
* @property string $city
* @property int|null $city_id
* @property string $code
* @property string $country
*
* @property City|null $city
* @property Collection|Flight[] $flights
*
* @package App\Models
@@ -28,13 +29,22 @@ class Airport extends Model
public $timestamps = false;
public static $snakeAttributes = false;
protected $casts = [
'city_id' => 'int'
];
protected $fillable = [
'name',
'city',
'city_id',
'code',
'country'
];
public function city()
{
return $this->belongsTo(City::class);
}
public function flights()
{
return $this->hasMany(Flight::class, 'departure_airport_id');