2025-08-22 15:57:14 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models\Commons;
|
|
|
|
|
|
2026-01-29 15:33:54 +09:00
|
|
|
use App\Traits\Auditable;
|
2025-08-22 15:57:14 +09:00
|
|
|
use App\Traits\BelongsToTenant;
|
|
|
|
|
use App\Traits\ModelTrait;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class CategoryTemplate extends Model
|
|
|
|
|
{
|
2026-01-29 15:33:54 +09:00
|
|
|
use Auditable, BelongsToTenant, ModelTrait;
|
2025-08-22 15:57:14 +09:00
|
|
|
|
|
|
|
|
protected $table = 'category_templates';
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
2025-11-06 17:45:49 +09:00
|
|
|
'tenant_id', 'category_id', 'version_no', 'template_json', 'applied_at',
|
|
|
|
|
'created_by', 'updated_by', 'deleted_by', 'remarks',
|
2025-08-22 15:57:14 +09:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
2025-11-06 17:45:49 +09:00
|
|
|
'version_no' => 'integer',
|
2025-08-22 15:57:14 +09:00
|
|
|
'template_json' => 'array',
|
2025-11-06 17:45:49 +09:00
|
|
|
'applied_at' => 'datetime',
|
2025-08-22 15:57:14 +09:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function category()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Category::class);
|
|
|
|
|
}
|
|
|
|
|
}
|