File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,9 @@ protected function setSort()
526
526
527
527
$ columnNameContainsDots = Str::contains ($ columnName , '. ' );
528
528
$ isRelation = $ this ->queries ->contains (function ($ query ) use ($ columnName ) {
529
+ // relationship should be camel case
530
+ $ columnName = Str::camel (Str::before ($ columnName , '. ' ));
531
+
529
532
return $ query ['method ' ] === 'with ' && in_array ($ columnName , $ query ['arguments ' ], true );
530
533
});
531
534
if ($ columnNameContainsDots === true && $ isRelation ) {
@@ -570,6 +573,8 @@ protected function setSort()
570
573
protected function setRelationSort ($ column )
571
574
{
572
575
list ($ relationName , $ relationColumn ) = explode ('. ' , $ column );
576
+ // relationship should be camel case
577
+ $ relationName = Str::camel ($ relationName );
573
578
574
579
if ($ this ->queries ->contains (function ($ query ) use ($ relationName ) {
575
580
return $ query ['method ' ] == 'with ' && in_array ($ relationName , $ query ['arguments ' ]);
You can’t perform that action at this time.
0 commit comments