File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ protected function setPaginate()
177177 return $ query ['method ' ] == 'paginate ' ;
178178 });
179179
180- if (! $ this ->usePaginate ) {
180+ if ($ this ->grid -> isHidePage () ) {
181181 $ query = [
182182 'method ' => 'get ' ,
183183 'arguments ' => [],
@@ -400,10 +400,8 @@ public function displayData($data)
400400 $ columns = $ this ->grid ->getColumns ();
401401 $ items = collect ();
402402
403-
404403 foreach ($ data as $ key => $ row ) {
405404 $ item = [];
406-
407405 foreach ($ this ->grid ->getAppendFields () as $ field ) {
408406 data_set ($ item , $ field , data_get ($ row , $ field ));
409407 }
@@ -476,19 +474,25 @@ public function get()
476474 $ this ->model = $ this ->relation ->getQuery ();
477475 }
478476
477+
479478 $ this ->setSort ();
479+
480+
480481 $ this ->setPaginate ();
481482
482483
483484 $ this ->queries ->unique ()->each (function ($ query ) {
484485 $ this ->model = call_user_func_array ([$ this ->model , $ query ['method ' ]], $ query ['arguments ' ]);
485486 });
486487
487-
488488 $ data = $ this ->model ;
489489
490490 if ($ this ->model instanceof Collection) {
491- return $ this ->displayData ($ data );
491+ if ($ data ->count () > 0 ) {
492+ return $ this ->displayData ($ data );
493+ } else {
494+ return $ data ;
495+ }
492496 }
493497
494498 if ($ this ->model instanceof LengthAwarePaginator) {
You can’t perform that action at this time.
0 commit comments