|
@@ -428,6 +428,8 @@ class Model
|
|
|
$this->data = collect();
|
|
|
}
|
|
|
|
|
|
+ $this->stdObjToArray($this->data);
|
|
|
+
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
@@ -487,8 +489,16 @@ class Model
|
|
|
$this->paginator = $paginator;
|
|
|
|
|
|
$paginator->setPageName($this->pageName);
|
|
|
+ }
|
|
|
|
|
|
- $paginator->getCollection()->transform(function ($item) {
|
|
|
+ /**
|
|
|
+ * @param Collection $collection
|
|
|
+ *
|
|
|
+ * @return Collection
|
|
|
+ */
|
|
|
+ protected function stdObjToArray(Collection $collection)
|
|
|
+ {
|
|
|
+ return $collection->transform(function ($item) {
|
|
|
if ($item instanceof \stdClass) {
|
|
|
return (array) $item;
|
|
|
}
|