Updated logo API
This commit is contained in:
@@ -23,6 +23,7 @@ class Aircraft extends Model
|
||||
|
||||
protected $appends = [
|
||||
'display_name',
|
||||
'display_name_short'
|
||||
];
|
||||
|
||||
protected function displayName() : Attribute{
|
||||
@@ -32,4 +33,14 @@ class Aircraft extends Model
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
protected function displayNameShort(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function () {
|
||||
$name = "{$this->manufacturer_code} {$this->model_full_name}";
|
||||
return trim(preg_replace('/\s*\(.*?\)/', '', $name));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user