52 lines
1.2 KiB
PHP
Executable File
52 lines
1.2 KiB
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Helpdesk\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
final class GitWebhookLog extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'helpdesk_git_webhook_logs';
|
|
|
|
/** @var list<string> */
|
|
protected $fillable = [
|
|
'repository_id',
|
|
'provider',
|
|
'delivery_id',
|
|
'event',
|
|
'status',
|
|
'message',
|
|
'commit_count',
|
|
'linked_count',
|
|
'ignored_count',
|
|
'payload',
|
|
'received_at',
|
|
];
|
|
|
|
/** @var array<string, string> */
|
|
protected $casts = [
|
|
'repository_id' => 'integer',
|
|
'commit_count' => 'integer',
|
|
'linked_count' => 'integer',
|
|
'ignored_count' => 'integer',
|
|
'payload' => 'array',
|
|
'received_at' => 'datetime',
|
|
];
|
|
|
|
/**
|
|
* Repository that received the provider webhook.
|
|
*
|
|
* @return BelongsTo<GitRepository, GitWebhookLog>
|
|
*/
|
|
public function repository(): BelongsTo
|
|
{
|
|
return $this->belongsTo(GitRepository::class, 'repository_id');
|
|
}
|
|
}
|