*/ protected $fillable = [ 'ticket_id', 'user_id', 'minutes', 'description', 'logged_at', 'started_at', 'ended_at', 'duration_seconds', ]; /** * The attributes that should be cast. * * @var array */ 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'); } }