diff --git a/src/SpladeQueryBuilder.php b/src/SpladeQueryBuilder.php index 0ad95762..78c7d9d4 100644 --- a/src/SpladeQueryBuilder.php +++ b/src/SpladeQueryBuilder.php @@ -209,7 +209,7 @@ private function applySorting(Column $column) ); } - if (!method_exists($this->builder, 'orderByLeftPowerJoins')) { + if (!trait_uses_recursive($this->builder->getModel(), PowerJoins::class)) { throw new PowerJoinsException( "To order the query using a column from a relationship, make sure the Model uses the 'PowerJoins' trait." );