Files
trustlab-api/app/Models/TicketReply.php
2025-12-30 12:32:54 +07:00

41 lines
762 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
class TicketReply extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'ticket_id',
'user_id',
'message',
'attachment_path',
];
/**
* Get the ticket that owns the reply.
*/
public function ticket()
{
return $this->belongsTo(Ticket::class);
}
/**
* Get the user that wrote the reply.
*/
public function user()
{
return $this->belongsTo(User::class);
}
public function attachments()
{
return $this->hasMany(TicketAttachment::class);
}
}