39 lines
825 B
PHP
39 lines
825 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\BelongsTo;
|
|
|
|
class HelpdeskReply extends Model
|
|
{
|
|
use HasFactory, BelongsToCompany;
|
|
|
|
protected $fillable = [
|
|
'ticket_id',
|
|
'message',
|
|
'attachments',
|
|
'is_internal',
|
|
'created_by',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'attachments' => 'array',
|
|
'is_internal' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function ticket(): BelongsTo
|
|
{
|
|
return $this->belongsTo(HelpdeskTicket::class, 'ticket_id');
|
|
}
|
|
|
|
public function creator(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
} |