2022-02-25 18:09:31 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
2025-07-21 20:55:30 +07:00
|
|
|
use App\Enums\ModelEventEnum;
|
2025-10-12 03:48:04 +07:00
|
|
|
use App\Models\Traits\NexusActivityLogTrait;
|
2025-07-21 20:55:30 +07:00
|
|
|
|
2022-02-25 18:09:31 +08:00
|
|
|
class AgentDeny extends NexusModel
|
|
|
|
|
{
|
2025-10-12 03:48:04 +07:00
|
|
|
use NexusActivityLogTrait;
|
|
|
|
|
|
2022-02-25 18:09:31 +08:00
|
|
|
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');
|
|
|
|
|
}
|
|
|
|
|
}
|