Files
nexusphp/app/Models/AgentDeny.php

33 lines
827 B
PHP
Raw Normal View History

2022-02-25 18:09:31 +08:00
<?php
namespace App\Models;
2025-07-21 20:55:30 +07:00
use App\Enums\ModelEventEnum;
2022-02-25 18:09:31 +08:00
class AgentDeny extends NexusModel
{
protected $table = 'agent_allowed_exception';
protected $fillable = [
'family_id', 'name', 'peer_id', 'agent', 'comment'
];
2025-07-21 20:55:30 +07:00
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);
});
}
2022-02-25 18:09:31 +08:00
public function family(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(AgentAllow::class, 'family_id');
}
}