35 lines
860 B
PHP
35 lines
860 B
PHP
<?php
|
|
|
|
namespace App\Domains\Webhook\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Webhook extends Model
|
|
{
|
|
use HasFactory, SoftDeletes;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'events' => 'array',
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
protected static function newFactory(): \Database\Factories\WebhookFactory
|
|
{
|
|
return \Database\Factories\WebhookFactory::new();
|
|
}
|
|
|
|
public function deliveries(): \Illuminate\Database\Eloquent\Relations\HasMany
|
|
{
|
|
return $this->hasMany(WebhookDelivery::class);
|
|
}
|
|
|
|
public function workspace(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
{
|
|
return $this->belongsTo(\App\Domains\Workspace\Models\Workspace::class);
|
|
}
|
|
}
|