Skip to content

Commit

Permalink
Use ForwardCalls in ApplyFiltersToQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Jul 18, 2022
1 parent a2035b7 commit c937ab5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Http/ApplyFiltersToQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\ForwardsCalls;
use OpenSoutheners\LaravelApiable\Contracts\HandlesRequestQueries;
use function OpenSoutheners\LaravelHelpers\Classes\class_namespace;

class ApplyFiltersToQuery implements HandlesRequestQueries
{
use ForwardsCalls;

/**
* @var array<array>
*/
Expand Down Expand Up @@ -107,7 +110,7 @@ protected function applyFilters(Builder $query, array $filters)
$scopeFn = Str::camel($attribute);

if ($this->isScope($queryModel, $scopeFn)) {
return call_user_func([$query, $scopeFn], $values);
return $this->forwardCallTo($query, $scopeFn, $values);
}
}, $query, $fullAttribute);
}
Expand Down

0 comments on commit c937ab5

Please sign in to comment.