Skip to content

Commit

Permalink
Ensure columns is an array. Closes statamic#2946
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Dec 4, 2020
1 parent a307c4b commit 7f4fd19
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Query/EloquentQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Statamic\Contracts\Query\Builder;
use Statamic\Extensions\Pagination\LengthAwarePaginator;
use Statamic\Support\Arr;

abstract class EloquentQueryBuilder implements Builder
{
Expand Down Expand Up @@ -91,6 +92,8 @@ abstract protected function transform($items, $columns = ['*']);

protected function selectableColumns($columns = ['*'])
{
$columns = Arr::wrap($columns);

if (! in_array('*', $columns)) {
// Any requested columns that aren't actually columns should just be
// ignored. In actual Laravel Query Builder, you'd get a database
Expand Down

0 comments on commit 7f4fd19

Please sign in to comment.