2021-05-15 19:29:44 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Category extends NexusModel
|
|
|
|
|
{
|
2021-05-20 23:30:34 +08:00
|
|
|
protected $table = 'categories';
|
2021-05-15 19:29:44 +08:00
|
|
|
|
2021-05-20 23:30:34 +08:00
|
|
|
protected $fillable = ['mode', 'name', 'class_name', 'image', 'sort_index', 'icon_id'];
|
2021-05-28 02:25:08 +08:00
|
|
|
|
2021-06-21 19:56:25 +08:00
|
|
|
public static function getLabelName()
|
|
|
|
|
{
|
|
|
|
|
return nexus_trans('searchbox.category_label');
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-28 02:25:08 +08:00
|
|
|
public function icon(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Icon::class, 'icon_id');
|
|
|
|
|
}
|
2021-05-15 19:29:44 +08:00
|
|
|
}
|