Add standalone support ticket system with customer and admin interfaces

Replaces planned SupportPal integration with a built-in ticket system.
Customer side: create tickets, reply, close. Admin side: manage all
tickets with search/filters, staff replies, status updates. Includes
30 Pest tests (144 total, 775 assertions).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Dev
2026-02-09 16:20:12 -05:00
parent 9603803928
commit 6f39c32270
23 changed files with 2343 additions and 76 deletions

View File

@@ -7,6 +7,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class SupportTicket extends Model
{
@@ -18,9 +19,11 @@ class SupportTicket extends Model
'subject',
'status',
'priority',
'department',
'last_reply_at',
];
/** @return array<string, string> */
protected function casts(): array
{
return [
@@ -33,4 +36,9 @@ class SupportTicket extends Model
{
return $this->belongsTo(User::class);
}
public function replies(): HasMany
{
return $this->hasMany(TicketReply::class, 'ticket_id');
}
}

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class TicketReply extends Model
{
use HasFactory;
protected $fillable = [
'ticket_id',
'user_id',
'body',
'is_staff_reply',
];
/** @return array<string, string> */
protected function casts(): array
{
return [
'is_staff_reply' => 'boolean',
];
}
public function ticket(): BelongsTo
{
return $this->belongsTo(SupportTicket::class, 'ticket_id');
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}