File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,9 @@ protected function setSort()
526526
527527 $ columnNameContainsDots = Str::contains ($ columnName , '. ' );
528528 $ isRelation = $ this ->queries ->contains (function ($ query ) use ($ columnName ) {
529+ // relationship should be camel case
530+ $ columnName = Str::camel (Str::before ($ columnName , '. ' ));
531+
529532 return $ query ['method ' ] === 'with ' && in_array ($ columnName , $ query ['arguments ' ], true );
530533 });
531534 if ($ columnNameContainsDots === true && $ isRelation ) {
@@ -570,6 +573,8 @@ protected function setSort()
570573 protected function setRelationSort ($ column )
571574 {
572575 list ($ relationName , $ relationColumn ) = explode ('. ' , $ column );
576+ // relationship should be camel case
577+ $ relationName = Str::camel ($ relationName );
573578
574579 if ($ this ->queries ->contains (function ($ query ) use ($ relationName ) {
575580 return $ query ['method ' ] == 'with ' && in_array ($ relationName , $ query ['arguments ' ]);
You can’t perform that action at this time.
0 commit comments