phases one of time logged now with log display

This commit is contained in:
Mark Gregory
2026-06-22 13:48:59 +01:00
parent 052bae718e
commit fcd60471be
13 changed files with 716 additions and 421 deletions
+66
View File
@@ -0,0 +1,66 @@
<?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
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'helpdesk_ticket_time_logs';
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'ticket_id',
'user_id',
'minutes',
'description',
'logged_at',
'started_at',
'ended_at',
'duration_seconds',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'ticket_id' => 'integer',
'user_id' => 'integer',
'minutes' => 'integer',
'duration_seconds' => 'integer',
'logged_at' => 'datetime',
'started_at' => 'datetime',
'ended_at' => 'datetime',
];
/**
* Get the ticket this time log belongs to.
*/
public function ticket(): BelongsTo
{
return $this->belongsTo(Ticket::class, 'ticket_id');
}
/**
* Get the user this time log belongs to.
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
}