File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,17 +126,21 @@ public static function table(Table $table): Table
126126 ]);
127127
128128 if ($ property && $ property ->enable_sorting ) {
129- $ table = $ table ->reorderable ('sort ' )->defaultSort ('sort ' );
129+ $ table = $ table
130+ ->reorderable ('sort ' )
131+ ->defaultSort ('sort ' )
132+ ->reorderRecordsTriggerAction (
133+ fn (Tables \Actions \Action $ action , bool $ isReordering ) => $ action
134+ ->button ()
135+ ->label ($ isReordering ? 'Disable reordering ' : 'Enable reordering ' )
136+ ->icon ($ isReordering ? 'heroicon-o-x-mark ' : 'heroicon-o-arrows-up-down ' )
137+ ->color ($ isReordering ? 'danger ' : 'primary ' )
138+ );
130139 } else {
131140 $ table = $ table ->defaultSort ('value ' );
132141 }
133142
134- return $ table
135- ->modifyQueryUsing (function (Builder $ query ) {
136- if (request ()->has ('property ' )) {
137- $ query ->where ('property_id ' , request ('property ' ));
138- }
139- });
143+ return $ table ;
140144 }
141145
142146 public static function getPages (): array
You can’t perform that action at this time.
0 commit comments