Added ticketing feature

This commit is contained in:
m.razaghi
2026-07-31 18:54:09 +03:30
parent d77605db75
commit 516bc4b26b
8 changed files with 406 additions and 0 deletions

25
app/Models/Ticket.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Ticket extends Model
{
protected $fillable = [
'user_id',
'subject',
'status', // 'open', 'answered', 'user_reply', 'closed'
'priority', // 'low', 'medium', 'high'
];
public function messages()
{
return $this->hasMany(TicketMessage::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class TicketMessage extends Model
{
protected $fillable = [
'ticket_id',
'user_id',
'message',
'attachment_path',
];
public function ticket()
{
return $this->belongsTo(Ticket::class);
}
}