mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
improve hr + agent update
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\ModelEventEnum;
|
||||
|
||||
class AgentDeny extends NexusModel
|
||||
{
|
||||
protected $table = 'agent_allowed_exception';
|
||||
@@ -10,6 +12,19 @@ class AgentDeny extends NexusModel
|
||||
'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');
|
||||
|
||||
Reference in New Issue
Block a user