Add more airlines and fix edit bugs

This commit is contained in:
2026-04-18 16:45:13 +10:00
parent 63d6fb9e76
commit d90f338321
12 changed files with 111 additions and 28 deletions
+11 -2
View File
@@ -2,6 +2,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
class Aircraft extends Model
@@ -20,7 +21,15 @@ class Aircraft extends Model
'engine_count' => 'integer',
];
public function displayName() : string{
return "{$this->manufacturer_code} {$this->model_full_name} ({$this->designator})";
protected $appends = [
'display_name',
];
protected function displayName() : Attribute{
return Attribute::make(
get: function () {
return "{$this->manufacturer_code} {$this->model_full_name} ({$this->designator})";
}
);
}
}