'integer', 'zfw' => 'float', 'state' => 'integer', ]; /** * Validation rules */ public static $rules = [ 'subfleet_id' => 'required', 'name' => 'required', 'registration' => 'required', ]; /** * See if this aircraft is active * @return bool */ public function getActiveAttribute(): bool { return $this->status === AircraftStatus::ACTIVE; } /** * Capitalize the ICAO when set * @param $icao */ public function setIcaoAttribute($icao): void { $this->attributes['icao'] = strtoupper($icao); } /** * foreign keys */ public function airport() { return $this->belongsTo(Airport::class, 'airport_id'); } public function subfleet() { return $this->belongsTo(Subfleet::class, 'subfleet_id'); } }