Add Container field

This commit is contained in:
Utkarsh Khedkar
2026-02-17 14:32:48 +05:30
parent 0a65d5f596
commit 94e211f87e
49 changed files with 8989 additions and 1290 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class ChatMessage extends Model
{
use HasFactory;
protected $fillable = [
'ticket_id',
'sender_id',
'sender_type', // user OR admin
'message',
'file_path',
'file_type',
];
/**
* The ticket this message belongs to.
*/
public function ticket()
{
return $this->belongsTo(SupportTicket::class, 'ticket_id');
}
/**
* Polymorphic sender (User or Admin)
*/
public function sender()
{
return $this->morphTo();
}
}