category search title

This commit is contained in:
Cihan Şentürk 2022-11-22 13:08:19 +03:00 committed by GitHub
parent fba6ff7318
commit 7201e08fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,8 @@ class Category extends Model
protected $table = 'categories';
protected $appends = ['display_name'];
/**
* Attributes that should be mass-assignable.
*
@ -227,6 +229,14 @@ class Category extends Model
return $this->getHexCodeOfTailwindClass($this->color);
}
/**
* Get the display name of the category.
*/
public function getDisplayNameAttribute()
{
return $this->name . ' (' . ucfirst($this->type) . ')';
}
/**
* Get the line actions.
*