Add more airlines and fix edit bugs
This commit is contained in:
+11
-2
@@ -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})";
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user