phase 6 added helpdesk

This commit is contained in:
Mark Gregory
2026-07-24 11:28:06 +01:00
parent 5ecf20fe97
commit 8c74abfbc6
212 changed files with 23064 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace Modules\Helpdesk\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class TicketTimeLog extends Model
{
use HasFactory;
protected $table = 'helpdesk_ticket_time_logs';
protected $fillable = [
'ticket_id',
'user_id',
'minutes',
'seconds',
'description',
'started_at',
'ended_at',
'logged_at',
];
protected function casts(): array
{
return [
'ticket_id' => 'integer',
'user_id' => 'integer',
'minutes' => 'integer',
'seconds' => 'integer',
'started_at' => 'datetime',
'ended_at' => 'datetime',
'logged_at' => 'datetime',
];
}
/**
* Get the ticket this time log belongs to.
*/
public function ticket(): BelongsTo
{
return $this->belongsTo(Ticket::class, 'ticket_id');
}
/**
* Get the user who logged the time.
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
}