34 lines
684 B
PHP
34 lines
684 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\BelongsToCompany;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class HelpdeskCategory extends Model
|
|
{
|
|
use HasFactory, BelongsToCompany;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'description',
|
|
'color',
|
|
'is_active',
|
|
'creator_id',
|
|
'created_by',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_active' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function tickets(): HasMany
|
|
{
|
|
return $this->hasMany(HelpdeskTicket::class, 'category_id');
|
|
}
|
|
} |