Skip to content

Commit a6fb72b

Browse files
committed
fix: raw methods should be using toBase and notGetQuery
1 parent d15f109 commit a6fb72b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ServiceProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,16 @@ public function register()
5050
public function addDbMacros()
5151
{
5252
EloquentBuilder::macro('getRaw', function (array $columns = ['*']) {
53-
return $this->/** @scrutinizer ignore-call */getQuery()
53+
/* @var \Illuminate\Database\Eloquent\Builder $this */
54+
return $this->/** @scrutinizer ignore-call */toBase()
5455
->get($columns)->map(function ($row) {
5556
return (array) $row;
5657
});
5758
});
5859

5960
EloquentBuilder::macro('paginateRaw', function ($limit = 25, array $columns = ['*'], $pageName = 'page', $page = null) {
60-
$result = $this->/** @scrutinizer ignore-call */getQuery()
61+
/* @var \Illuminate\Database\Eloquent\Builder $this */
62+
$result = $this->/** @scrutinizer ignore-call */toBase()
6163
->paginate($limit, $columns, $pageName, $page);
6264

6365
$collection = $result->getCollection()->map(function ($row) {

0 commit comments

Comments
 (0)