Skip to content

Commit

Permalink
fix: accept string in filters (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryk authored Sep 7, 2023
1 parent 13fa577 commit bc9d263
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Filters/SortCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public function hydrateDefinition(Repository $repository): SortCollection

$definition = Arr::get($repository::sorts(), $filter->column());

if (is_string($definition) && class_exists($definition)) {
$definition = app($definition);
}

if (is_callable($definition)) {
return $filter->usingClosure($definition);
}
Expand Down

0 comments on commit bc9d263

Please sign in to comment.