Files
nexusphp/app/Models/Category.php

27 lines
569 B
PHP
Raw Normal View History

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');
}
2022-10-27 20:21:54 +08:00
public function search_box()
{
return $this->belongsTo(SearchBox::class, 'mode', 'id');
}
2021-05-15 19:29:44 +08:00
}