File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -673,10 +673,14 @@ protected function hasOrderColumn($column)
673
673
*/
674
674
protected function applyOrderColumn ($ column , $ orderable )
675
675
{
676
- $ sql = $ this ->columnDef ['order ' ][$ column ]['sql ' ];
677
- $ sql = str_replace ('$1 ' , $ orderable ['direction ' ], $ sql );
678
- $ bindings = $ this ->columnDef ['order ' ][$ column ]['bindings ' ];
679
- $ this ->query ->orderByRaw ($ sql , $ bindings );
676
+ $ sql = $ this ->columnDef ['order ' ][$ column ]['sql ' ];
677
+ if (is_callable ($ sql )) {
678
+ call_user_func ($ sql , $ this ->query , $ orderable ['direction ' ]);
679
+ } else {
680
+ $ sql = str_replace ('$1 ' , $ orderable ['direction ' ], $ sql );
681
+ $ bindings = $ this ->columnDef ['order ' ][$ column ]['bindings ' ];
682
+ $ this ->query ->orderByRaw ($ sql , $ bindings );
683
+ }
680
684
}
681
685
682
686
/**
You can’t perform that action at this time.
0 commit comments