UserTag.php
956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace App\Models;
use App\Support\Model;
use App\Traits\JsonColumnDirtyTrait;
use Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class UserTag extends Model
{
use SoftDeletes, JsonColumnDirtyTrait;
protected $table = 'user_tags';
protected $guarded = [];
protected $casts = ['frame' => 'json'];
protected $hidden = ['deleted_at'];
public array $columnMap = [
'name' => '名称',
'icon' => '图标',
'weight' => '权重值',
'index_filter' => '筛选值',
'frame' => '边框',
'frame->url' => '边框图标',
'frame->color' => '边框颜色',
'status' => '状态'
];
/**
* @return \Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}