43 lines
876 B
PHP
43 lines
876 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\TicketWorklogEntryFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Fillable([
|
|
'actor_id',
|
|
'changes',
|
|
'entry_type',
|
|
'summary',
|
|
'ticket_id',
|
|
])]
|
|
class TicketWorklogEntry extends Model
|
|
{
|
|
/** @use HasFactory<TicketWorklogEntryFactory> */
|
|
use HasFactory;
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'changes' => 'array',
|
|
];
|
|
}
|
|
|
|
public function actor(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'actor_id');
|
|
}
|
|
|
|
public function ticket(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Ticket::class);
|
|
}
|
|
}
|