fix:edit models
This commit is contained in:
+13
-2
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user