Skip to content

Commit 85a7e8b

Browse files
Merge pull request #115 from ricardorzgz/patch-1
Fixed PHP fatal error when working with Laravel Database 5.2
2 parents cd37044 + 779cfa7 commit 85a7e8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Phpmig/Adapter/Illuminate/Database.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ public function fetchAll()
4444
$all = $this->adapter
4545
->table($this->tableName)
4646
->orderBy('version')
47-
->get()->toArray();
47+
->get();
48+
49+
if(!is_array($all)) {
50+
$all = $all->toArray();
51+
}
4852

4953
return array_map(function($v) use($fetchMode) {
5054

0 commit comments

Comments
 (0)