style updates

This commit is contained in:
Mark Gregory
2026-07-24 14:59:44 +01:00
parent 24ab771cd3
commit dd23205d0b
482 changed files with 7173 additions and 1435 deletions
+26 -2
View File
@@ -1,4 +1,28 @@
<?php
namespace Modules\Api\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany;
final class Webhook extends Model {protected $fillable=['site_id','name','url','secret','events','is_active','failure_count','last_triggered_at'];protected $hidden=['secret'];protected function casts(): array{return ['events'=>'array','is_active'=>'boolean','last_triggered_at'=>'datetime'];}public function deliveries(): HasMany{return $this->hasMany(WebhookDelivery::class);}public function subscribesTo(string $event): bool{return in_array('*',$this->events?:[],true)||in_array($event,$this->events?:[],true);}}
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
final class Webhook extends Model
{
protected $fillable = ['site_id', 'name', 'url', 'secret', 'events', 'is_active', 'failure_count', 'last_triggered_at'];
protected $hidden = ['secret'];
protected function casts(): array
{
return ['events' => 'array', 'is_active' => 'boolean', 'last_triggered_at' => 'datetime'];
}
public function deliveries(): HasMany
{
return $this->hasMany(WebhookDelivery::class);
}
public function subscribesTo(string $event): bool
{
return in_array('*', $this->events ?: [], true) || in_array($event, $this->events ?: [], true);
}
}