34 lines
634 B
PHP
34 lines
634 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TicketMessage extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public const SenderUser = 'user';
|
|
|
|
public const SenderAdmin = 'admin';
|
|
|
|
protected $fillable = [
|
|
'ticket_id',
|
|
'user_id',
|
|
'sender_type',
|
|
'content',
|
|
];
|
|
|
|
public function ticket(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Ticket::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|