mirror of
https://github.com/pelican-dev/panel.git
synced 2025-03-14 09:57:36 +00:00
* Not found property rule * Make these “better” * Day 1 * Day 2 * Day 3 * Dat 4 * Remove disabled check * Day 4 continued * Run pint * Final changes hopefully * Pint fixes * Fix again * Reset these * Update app/Filament/Admin/Pages/Health.php Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com> * Update app/Traits/CheckMigrationsTrait.php Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com> --------- Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>
38 lines
972 B
PHP
38 lines
972 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;
|
|
|
|
/**
|
|
* @property string $event
|
|
* @property string $endpoint
|
|
* @property \Illuminate\Support\Carbon|null $successful_at
|
|
* @property array<array-key, mixed> $payload
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
*/
|
|
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')));
|
|
}
|
|
}
|