Skip to content

Commit

Permalink
Prepare 2.1.0 release.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Mar 2, 2021
1 parent f444d22 commit 1433b5c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG-2.x.md
Expand Up @@ -2,6 +2,15 @@

This changelog references the relevant changes (bug and security fixes) done to `laravie/query-filter`.

## 2.1.0

Released: 2021-03-02

### Added

* Added ability to disable wildcard searching using `noWildcardSearching()` method (reverse of `allowWildcardSearching()`) from `Searchable`, `Taxanomy` and `Field` classes.
* Added ability to set wildcard character to be replaced using `wildcardCharacter()`, this can be disable by setting it to `null`.

## 2.0.0

Released: 2020-09-07
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -135,7 +135,7 @@ $query = App\User::query();

$searchable = (new Searchable(
'crynobone@gmail', ['name', 'email']
))->withoutWildcardSearching();
))->noWildcardSearching();

return $searchable->apply($query)->get();
```
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/ConditionallySearchingWildcard.php
Expand Up @@ -16,7 +16,7 @@ trait ConditionallySearchingWildcard
*
* @return $this
*/
public function withWildcardSearching()
public function allowWildcardSearching()
{
$this->wildcardSearching = true;

Expand All @@ -28,7 +28,7 @@ public function withWildcardSearching()
*
* @return $this
*/
public function withoutWildcardSearching()
public function noWildcardSearching()
{
$this->wildcardSearching = false;

Expand Down
4 changes: 2 additions & 2 deletions src/Taxonomy.php
Expand Up @@ -70,9 +70,9 @@ protected function matchBasicConditions($query): void
->wildcardCharacter($this->wildcardCharacter)
->tap(function (Searchable $searchable) {
if (($this->wildcardSearching ?? true) === true) {
$searchable->withWildcardSearching();
$searchable->allowWildcardSearching();
} else {
$searchable->withoutWildcardSearching();
$searchable->noWildcardSearching();
}
})->apply($query);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/FluentSearchableTest.php
Expand Up @@ -36,7 +36,7 @@ public function it_can_build_search_query_with_exact_keyword()
{
$stub = (new Searchable(
'hello', [new Expression('users.name')]
))->withoutWildcardSearching();
))->noWildcardSearching();

$query = DB::table('users');
$stub->apply($query);
Expand All @@ -57,7 +57,7 @@ public function it_can_build_search_query_with_exact_keyword()
public function it_can_build_search_query_with_exact_keyword_on_column()
{
$stub = new Searchable(
'hello', [(new Field('name'))->withoutWildcardSearching(), 'email']
'hello', [(new Field('name'))->noWildcardSearching(), 'email']
);

$query = DB::table('users');
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/FluentTaxanomyTest.php
Expand Up @@ -96,7 +96,7 @@ public function it_can_build_match_query_with_basic_search_with_exact_keyword()
{
$stub = (new Taxonomy(
'hello', [], ['name']
))->withoutWildcardSearching();
))->noWildcardSearching();

$query = DB::table('users');
$stub->apply($query);
Expand Down

0 comments on commit 1433b5c

Please sign in to comment.