49 lines
890 B
PHP
49 lines
890 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Helpdesk\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
final class GitCommit extends Model
|
|
{
|
|
protected $table = 'git_commits';
|
|
|
|
/**
|
|
* @var array<int,string>
|
|
*/
|
|
protected $fillable = [
|
|
'repository_full_name',
|
|
'repository_name',
|
|
'ticket_id',
|
|
'sha',
|
|
'branch',
|
|
'author_name',
|
|
'author_email',
|
|
'message',
|
|
'commit_url',
|
|
'committed_at',
|
|
'payload',
|
|
];
|
|
|
|
/**
|
|
* @var array<string,string>
|
|
*/
|
|
protected $casts = [
|
|
'payload' => 'array',
|
|
'committed_at' => 'datetime',
|
|
];
|
|
|
|
/**
|
|
* Related helpdesk ticket.
|
|
*/
|
|
public function ticket(): BelongsTo
|
|
{
|
|
return $this->belongsTo(
|
|
Ticket::class,
|
|
);
|
|
}
|
|
}
|