Skip to content

Commit

Permalink
return $q to make laravel's count() work
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienTant committed May 12, 2015
1 parent 9367f52 commit e04732c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SearchableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function scopeSearch(Builder $q, $search, $threshold = null)

if ( ! $search)
{
return $query;
return $q;
}

$search = strtolower($search);
Expand Down Expand Up @@ -61,7 +61,7 @@ public function scopeSearch(Builder $q, $search, $threshold = null)

$this->mergeQueries($query, $q);

return $query;
return $q;
}

/**
Expand Down

1 comment on commit e04732c

@daack
Copy link

@daack daack commented on e04732c Jun 8, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe is a problem of my implementation. But with this fix my code doesn't work anymore

SQLSTATE[42S22]: Column not found: 1054 Unknown column

Sorry, i just read your comment on my commit

Please sign in to comment.