mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
31 lines
647 B
PHP
31 lines
647 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
use App\Models\Traits\NexusActivityLogTrait;
|
|
|
|
class Category extends NexusModel
|
|
{
|
|
use NexusActivityLogTrait;
|
|
|
|
protected $table = 'categories';
|
|
|
|
protected $fillable = ['mode', 'name', 'class_name', 'image', 'sort_index', 'icon_id'];
|
|
|
|
public static function getLabelName()
|
|
{
|
|
return nexus_trans('searchbox.category_label');
|
|
}
|
|
|
|
public function icon(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
{
|
|
return $this->belongsTo(Icon::class, 'icon_id');
|
|
}
|
|
|
|
public function search_box()
|
|
{
|
|
return $this->belongsTo(SearchBox::class, 'mode', 'id');
|
|
}
|
|
}
|