2.1
BREAKING CHANGES
- removed
filterByList
method assertMailEquals
method now works with the mailable class which implementsIlluminate\Contracts\Queue\ShouldQueue
interface
FEATURES
New search filters processing
Any field, passed to the search
method will be interpreted as a search filter without calling filterBy
method
//UserService
public function search($filters)
{
return $this
->searchQuery($filters)
->getSearchResults()
}
protected function getByRole($roleId)
{
return $this->search(['role_id' => $roleId]); //will return search by role_id match $roleId
}
There are other reserved filter postfix that will be proceed automatically:
_from
_to
_in_list
_not_in_list
And reserved filter names:
with
with_count
$service->search([
'with' => ['role'],
'with_count' => ['mentors'],
'salary_from' => 100,
'started_at_from' => '2022-01-01',
'status_in_list' = ['active', 'pending'],
'type_not_in_list' => ['new', 'legacy']
]);
To skip filter from the automatically processing - please call setAdditionalReservedFilters
method
//UserRepository.php
public function __construct()
{
$this->setAdditionalReservedFilters('only_mentors', 'with_geo_data');
}
Global export mode
To enable global export mode inside the all tests, just call setGlobalExportMode
method in your base TestCase setUp
method.
In this mode - all assertEqualsFixture
methods will export the data to the fixture before the assert.
What's Changed
- Dpankratov/version update by @DenTray in #17
- 60 implement major version 2 by @DenTray in #16
- Fixed bug with scopeOrderByRelated method in Laravel 8 by @DenTray in #18
- Dpankratov/minime annotations removing by @DenTray in #19
- #-: by @DenTray in #20
- #-: by @DenTray in #21
- Dpankratov/jwt requirement removing by @DenTray in #22
- Dpankrastov/jwt package removing by @DenTray in #23
- Dpankratov/remove apply show hidden by @DenTray in #24
- fix: remove useless typehints; by @DenTray in #25
- fix: remove jwt using in HelpersServiceProvider.php; by @DenTray in #26
- chore: code reformat; by @DenTray in #27
- Dpankratov/master refactoring by @DenTray in #28
- Dpankratov/master refactoring by @DenTray in #31
- feat: update documentation; by @DenTray in #30
- #29 save file method should return name of the file as result by @DenTray in #32
- #64: optimize "filter by" by @pirs1337 in #36
- #61: move "with" filters into searchQuery by @pirs1337 in #35
- #62:- add global export mode by @pirs1337 in #38
- #65: optimize search by @pirs1337 in #37
- #48:- fix
assertMailEquals
by @pirs1337 in #39 - #40: adding setter for
reservedFilters
by @pirs1337 in #41 - #65:- optimize search by @pirs1337 in #42
New Contributors
Full Changelog: 1.5.2...2.1