From 7201e08fa2915cbd9c2105427ccf4ce5798434b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= <53110792+CihanSenturk@users.noreply.github.com> Date: Tue, 22 Nov 2022 13:08:19 +0300 Subject: [PATCH] category search title --- app/Models/Setting/Category.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Models/Setting/Category.php b/app/Models/Setting/Category.php index 68b0a70fa..503101fb4 100644 --- a/app/Models/Setting/Category.php +++ b/app/Models/Setting/Category.php @@ -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. *