Skip to content

Commit

Permalink
category search title
Browse files Browse the repository at this point in the history
  • Loading branch information
CihanSenturk committed Nov 22, 2022
1 parent fba6ff7 commit 7201e08
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 7201e08

Please sign in to comment.