agnet allow deny clear cahce after delete + VIP above never demotion

This commit is contained in:
xiaomlove
2023-04-15 01:22:23 +08:00
parent 9805d0fac6
commit e39d6f013f
6 changed files with 33 additions and 6 deletions

View File

@@ -74,6 +74,11 @@ class AgentAllowResource extends Resource
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make()->using(function ($record) {
$record->delete();
clear_agent_allow_deny_cache();
return redirect(self::getUrl());
})
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),

View File

@@ -3,6 +3,7 @@
namespace App\Filament\Resources\System\AgentAllowResource\Pages;
use App\Filament\Resources\System\AgentAllowResource;
use App\Models\NexusModel;
use Filament\Pages\Actions;
use Filament\Resources\Pages\EditRecord;
@@ -13,7 +14,11 @@ class EditAgentAllow extends EditRecord
protected function getActions(): array
{
return [
Actions\DeleteAction::make(),
Actions\DeleteAction::make()->using(function ($record) {
$record->delete();
clear_agent_allow_deny_cache();
return redirect(AgentAllowResource::getUrl());
})
];
}

View File

@@ -62,6 +62,11 @@ class AgentDenyResource extends Resource
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make()->using(function ($record) {
$record->delete();
clear_agent_allow_deny_cache();
return redirect(self::getUrl());
})
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),

View File

@@ -13,7 +13,11 @@ class EditAgentDeny extends EditRecord
protected function getActions(): array
{
return [
Actions\DeleteAction::make(),
Actions\DeleteAction::make()->using(function ($record) {
$record->delete();
clear_agent_allow_deny_cache();
return redirect(AgentDenyResource::getUrl());
})
];
}