Skip to content

Commit

Permalink
fix typo in README (#194)
Browse files Browse the repository at this point in the history
* fix typo in README

* Apply fixes from StyleCI (#195)

Co-authored-by: StyleCI Bot <bot@styleci.io>

---------

Co-authored-by: Austin Williams <austin@gavel.io>
Co-authored-by: Eric Tucker <tucker.ericm@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
  • Loading branch information
4 people committed Jan 6, 2024
1 parent b7f51ea commit 19c31e5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class UserFilter extends ModelFilter
##### Adding Relation Values To Filter

Sometimes, based on the value of a parameter you may need to push data to a relation filter. The `push()` method does just this.
It accepts one argument as an array of key value pairs or to arguments as a key value pair `push($key, $value)`.
It accepts one argument as an array of key value pairs or two arguments as a key value pair `push($key, $value)`.
Related models are filtered AFTER all local values have been executed you can use this method in any filter method.
This avoids having to query a related table more than once. For Example:

Expand Down
8 changes: 4 additions & 4 deletions tests/ModelFilterChildTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ public function testPaginationWorksOnBelongsToMany()
protected function dbSetup()
{
$config = collect([
'database.fetch' => PDO::FETCH_CLASS,
'database.default' => 'sqlite',
'database.fetch' => PDO::FETCH_CLASS,
'database.default' => 'sqlite',
'database.connections' => [
'sqlite' => [
'driver' => 'sqlite',
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
'prefix' => '',
],
],
]);
Expand Down
14 changes: 7 additions & 7 deletions tests/ModelFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ public function testPush()
// Test with inserting array
$this->filter->push([
'company_id' => '2',
'roles' => ['1', '4', '7'],
'roles' => ['1', '4', '7'],
]);

$this->assertEquals($this->filter->input(), [
'name' => 'er',
'name' => 'er',
'company_id' => '2',
'roles' => ['1', '4', '7'],
'roles' => ['1', '4', '7'],
]);
}

Expand Down Expand Up @@ -113,12 +113,12 @@ public function testInputMethod()
public function testGetFilterMethod()
{
$input = [
'name' => 'name',
'first_name' => 'firstName',
'name' => 'name',
'first_name' => 'firstName',
'first_or_last_name' => 'firstOrLastName',
// Test dot-notation works
'Company.Name' => 'companyName',
'Company-Name' => 'companyName',
'Company.Name' => 'companyName',
'Company-Name' => 'companyName',
];

foreach ($input as $key => $method) {
Expand Down
10 changes: 5 additions & 5 deletions tests/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

return [
'test_input' => [
'name' => 'er',
'last_name' => '',
'name' => 'er',
'last_name' => '',
'company_id' => '2',
'roles' => ['1', '4', '7'],
'industry' => '',
'other' => [],
'roles' => ['1', '4', '7'],
'industry' => '',
'other' => [],
],
];

0 comments on commit 19c31e5

Please sign in to comment.