Skip to content

Commit 71a96bd

Browse files
authored
Merge pull request #2 from a21ns1g4ts/patch-1
Fix soft delete scope in FirewallIpResource.php
2 parents 9b1188f + 0fb8396 commit 71a96bd

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/Filament/Resources/FirewallIpResource.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use Filament\Resources\Resource;
88
use Filament\Resources\Table;
99
use Filament\Tables;
10+
use Illuminate\Database\Eloquent\Builder;
11+
use Illuminate\Database\Eloquent\SoftDeletingScope;
1012
use Illuminate\Support\Facades\Request;
1113
use Illuminate\Support\Str;
1214
use SolutionForest\FilamentFirewall\Filament\Resources\FirewallIpResource\Pages;
@@ -22,14 +24,13 @@ public static function form(Form $form): Form
2224
->default(fn () => Request::getClientIp())
2325
->regex('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/')
2426
->validationAttribute(Str::upper(__('filament-firewall::filament-firewall.form.field.ip')))
25-
->suffixAction(fn (callable $set) =>
26-
Forms\Components\Actions\Action::make('fillMyIp')
27-
->label(__('filament-firewall::filament-firewall.action.fillMyIp'))
28-
->icon('heroicon-o-pencil-alt')
29-
->action(fn () => $set('ip', Request::getClientIp()))
27+
->suffixAction(fn (callable $set) => Forms\Components\Actions\Action::make('fillMyIp')
28+
->label(__('filament-firewall::filament-firewall.action.fillMyIp'))
29+
->icon('heroicon-o-pencil-alt')
30+
->action(fn () => $set('ip', Request::getClientIp()))
3031
)
3132
->required(),
32-
33+
3334
Forms\Components\TextInput::make('prefix_size')
3435
->label(__('filament-firewall::filament-firewall.form.field.prefix_size'))
3536
->numeric()
@@ -133,4 +134,12 @@ protected static function getNavigationGroup(): ?string
133134
{
134135
return __('filament-firewall::filament-firewall.filament.resource.ip.getNavigationGroup');
135136
}
137+
138+
public static function getEloquentQuery(): Builder
139+
{
140+
return parent::getEloquentQuery()
141+
->withoutGlobalScopes([
142+
SoftDeletingScope::class,
143+
]);
144+
}
136145
}

0 commit comments

Comments
 (0)