mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 16:46:51 +01:00 
			
		
		
		
	* update composer.lock * run pint * fix phpstan * update migrations (sqlite `dropForeign`) * fix migrations * Reset these back for now * Alphabetize the rules * run `php artisan filament:upgrade` --------- Co-authored-by: Lance Pioch <git@lance.sh>
		
			
				
	
	
		
			38 lines
		
	
	
		
			954 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			954 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 $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')));
 | 
						|
    }
 | 
						|
}
 |