Skip to content

Commit

Permalink
Fixes searching null
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Dec 19, 2018
1 parent 5728f84 commit 46c9405
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@

final class Builder extends BaseBuilder
{
/**
* {@inheritdoc}
*
* @see https://github.com/algolia/scout-extended/issues/98
*/
public function __construct($model, $query, $callback = null, $softDelete = false)
{
parent::__construct($model, (string) $query, $callback, $softDelete);
}

/**
* Customize the search to be around a given location.
*
Expand Down
5 changes: 5 additions & 0 deletions tests/Features/BuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ public function testAroundLatLng(): void

User::search('bar')->aroundLatLng(48.8566, 2.3522)->get();
}

public function testQueryIsString(): void
{
$this->assertTrue(User::search(null)->query === '');
}
}

0 comments on commit 46c9405

Please sign in to comment.