42 lines
886 B
PHP
Executable File
42 lines
886 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Helpdesk\Models;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
final class TimeLog extends Model
|
|
{
|
|
protected $table = 'helpdesk_time_logs';
|
|
|
|
/** @var list<string> */
|
|
protected $fillable = [
|
|
'ticket_id',
|
|
'user_id',
|
|
'minutes',
|
|
'description',
|
|
'logged_at',
|
|
];
|
|
|
|
/** @var array<string, string> */
|
|
protected $casts = [
|
|
'minutes' => 'integer',
|
|
'logged_at' => 'datetime',
|
|
];
|
|
|
|
/** @return BelongsTo<Ticket, TimeLog> */
|
|
public function ticket(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Ticket::class, 'ticket_id');
|
|
}
|
|
|
|
/** @return BelongsTo<User, TimeLog> */
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
}
|