feat: initial dashboard-ticketing scaffold

This commit is contained in:
Joel Wedemire
2026-04-08 14:17:26 -07:00
parent 1448eb7cf4
commit 81d0d54f50
13 changed files with 980 additions and 0 deletions

35
src/Models/Ticket.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
namespace Dashboard\Ticketing\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Ticket extends Model
{
protected $fillable = [
'user_id',
'assigned_to',
'title',
'description',
'category',
'priority',
'status',
];
public function submitter(): BelongsTo
{
return $this->belongsTo(\App\Models\User::class, 'user_id');
}
public function assignee(): BelongsTo
{
return $this->belongsTo(\App\Models\User::class, 'assigned_to');
}
public function comments(): HasMany
{
return $this->hasMany(TicketComment::class);
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Dashboard\Ticketing\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class TicketComment extends Model
{
protected $fillable = [
'ticket_id',
'user_id',
'body',
'is_internal',
];
protected $casts = [
'is_internal' => 'boolean',
];
public function ticket(): BelongsTo
{
return $this->belongsTo(Ticket::class);
}
public function author(): BelongsTo
{
return $this->belongsTo(\App\Models\User::class, 'user_id');
}
}