mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 22:20:57 +08:00
36 lines
904 B
PHP
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');
|
|
}
|
|
}
|