Files
nexusphp/app/Models/AgentDeny.php
2025-10-12 04:13:18 +07:00

36 lines
904 B
PHP

<?php
namespace App\Models;
use App\Enums\ModelEventEnum;
use App\Models\Traits\NexusActivityLogTrait;
class AgentDeny extends NexusModel
{
use NexusActivityLogTrait;
protected $table = 'agent_allowed_exception';
protected $fillable = [
'family_id', 'name', 'peer_id', 'agent', 'comment'
];
protected static function booted()
{
static::created(function ($model) {
fire_event(ModelEventEnum::AGENT_DENY_CREATED, $model);
});
static::updated(function ($model) {
fire_event(ModelEventEnum::AGENT_DENY_UPDATED, $model);
});
static::deleted(function ($model) {
fire_event(ModelEventEnum::AGENT_DENY_DELETED, $model);
});
}
public function family(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(AgentAllow::class, 'family_id');
}
}