File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Forms/Components/ContentTree/Filter Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace SolutionForest \InspireCms \Filament \Forms \Components \ContentTree \Filter ;
4+
5+ class WithoutGlobalScope extends BaseFilter
6+ {
7+ public function __construct (
8+ protected string $ scopeClass ,
9+ ) {}
10+
11+ public function toLivewire ()
12+ {
13+ return [
14+ 'scopeClass ' => $ this ->scopeClass ,
15+ ];
16+ }
17+
18+ public static function fromLivewire ($ value )
19+ {
20+ return new static ($ value ['scopeClass ' ]);
21+ }
22+
23+ public function applyToQuery ($ query )
24+ {
25+ $ query ->withoutGlobalScope ($ this ->scopeClass );
26+
27+ return $ query ;
28+ }
29+ }
Original file line number Diff line number Diff line change 1010use Filament \Tables \Table ;
1111use Illuminate \Database \Eloquent \Builder ;
1212use Illuminate \Database \Eloquent \Model ;
13+ use Illuminate \Database \Eloquent \SoftDeletingScope ;
1314use SolutionForest \InspireCms \Base \Enums \NavigationType ;
1415use SolutionForest \InspireCms \Facades \InspireCms ;
1516use SolutionForest \InspireCms \Filament \Clusters \Settings ;
@@ -209,7 +210,7 @@ protected static function getContentFormComponent()
209210 null ;
210211 })
211212 // display deleted content
212- ->where (new ContentPickerFilters \BuilderFilter ( ' withTrashed ' ));
213+ ->where (new ContentPickerFilters \WithoutGlobalScope (SoftDeletingScope::class ));
213214 }
214215
215216 /**
You can’t perform that action at this time.
0 commit comments