feat: add desciption to category and sub category
This commit is contained in:
@@ -6,7 +6,14 @@
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
protected $fillable = ['name'];
|
||||
protected $fillable = ['name', 'description', 'icon'];
|
||||
|
||||
protected $appends = ['icon_url'];
|
||||
|
||||
public function getIconUrlAttribute(): ?string
|
||||
{
|
||||
return $this->icon ? asset('storage/' . $this->icon) : null;
|
||||
}
|
||||
|
||||
public function questions()
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ class SubCategory extends Model
|
||||
{
|
||||
protected $table = 'sub_categories';
|
||||
|
||||
protected $fillable = ['category_id', 'name'];
|
||||
protected $fillable = ['category_id', 'name', 'description'];
|
||||
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user