<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class WebhookDelivery extends Model {
 protected $fillable=['event_id','endpoint_id','payload','raw_payload','signature','attempt_count','next_attempt_at','status','last_response_code','last_error','delivered_at','exhausted_at'];protected function casts():array{return ['payload'=>'array','next_attempt_at'=>'datetime','delivered_at'=>'datetime','exhausted_at'=>'datetime'];}public function endpoint(){return $this->belongsTo(WebhookEndpoint::class,'endpoint_id');}public function attempts(){return $this->hasMany(WebhookDeliveryAttempt::class,'delivery_id');}}
