mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00

* Add prune & event blacklist * Pinted 3times with --dirty bruh * Add to Settings * Fix prune & description * Prune Logs not Configuration
30 lines
687 B
PHP
30 lines
687 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\MassPrunable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Webhook extends Model
|
|
{
|
|
use HasFactory, MassPrunable;
|
|
|
|
protected $fillable = ['payload', 'successful_at', 'event', 'endpoint'];
|
|
|
|
public function casts()
|
|
{
|
|
return [
|
|
'payload' => 'array',
|
|
'successful_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function prunable(): Builder
|
|
{
|
|
return static::where('created_at', '<=', Carbon::now()->subDays(config('panel.webhook.prune_days')));
|
|
}
|
|
}
|