Skip to content

Commit

Permalink
Emit advanced filters applied event.
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryk committed Jun 28, 2021
1 parent d1d4c62 commit 01171bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Events/AdvancedFiltersApplied.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
namespace Binaryk\LaravelRestify\Events;

use Binaryk\LaravelRestify\Filters\AdvancedFiltersCollection;
use Binaryk\LaravelRestify\Repositories\Repository;

class AdvancedFiltersApplied
{
public function __construct(
public AdvancedFiltersCollection $advancedFiltersCollection
public Repository $repository,
public AdvancedFiltersCollection $advancedFiltersCollection,
) {
}
}
1 change: 1 addition & 0 deletions src/Services/Search/RepositorySearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ protected function applyFilters(RestifyRequest $request, Repository $repository,
{
event(
new AdvancedFiltersApplied(
$repository,
AdvancedFiltersCollection::collectQueryFilters($request, $repository)
->apply($request, $query)
)
Expand Down

0 comments on commit 01171bc

Please sign in to comment.