fix:edit models

This commit is contained in:
2026-08-17 13:13:45 -07:00
parent 5e61ca4289
commit 571c933476
5 changed files with 54 additions and 20 deletions
+13 -2
View File
@@ -14,10 +14,11 @@ use Illuminate\Database\Eloquent\Model;
*
* @property int $id
* @property string $name
* @property string $city
* @property int $city_id
* @property string $country
* @property string $code
*
* @property City $city
* @property Collection|Flight[] $flights
*
* @package App\Models
@@ -26,14 +27,24 @@ class Airport extends Model
{
protected $table = 'airports';
public $timestamps = false;
public static $snakeAttributes = false;
protected $casts = [
'city_id' => 'int'
];
protected $fillable = [
'name',
'city',
'city_id',
'country',
'code'
];
public function city()
{
return $this->belongsTo(City::class);
}
public function flights()
{
return $this->hasMany(Flight::class, 'departure_airport_id');