Skip to content

Commit

Permalink
Merge pull request #71 from shaffe-fr/patch-1
Browse files Browse the repository at this point in the history
Recursively detect Spatie's SortableTrait
  • Loading branch information
Tarpsvo authored Jan 13, 2021
2 parents 9fb653e + 5816760 commit 5591003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Traits/HasSortableRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static function getSortabilityConfiguration($model): ?array
if (is_null($model)) return null;

// Check if spatie trait is in the model.
if (!in_array(SortableTrait::class, array_keys((new \ReflectionClass($model))->getTraits()))) {
if (! in_array(SortableTrait::class, class_uses_recursive($model))) {
return null;
}

Expand Down

0 comments on commit 5591003

Please sign in to comment.