Skip to content

Commit

Permalink
Merge pull request #2851 from CihanSenturk/category-types-may-be-conf…
Browse files Browse the repository at this point in the history
…using

Category search title
  • Loading branch information
cuneytsenturk committed Dec 29, 2022
2 parents 6b2fb6f + 7201e08 commit e8f3cb0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/Models/Setting/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class Category extends Model

protected $table = 'categories';

protected $appends = ['display_name'];

/**
* Attributes that should be mass-assignable.
*
Expand Down Expand Up @@ -227,6 +229,14 @@ public function getColorHexCodeAttribute(): string
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.
*
Expand Down

0 comments on commit e8f3cb0

Please sign in to comment.