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)
673673 */
674674 protected function applyOrderColumn ($ column , $ orderable )
675675 {
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+ }
680684 }
681685
682686 /**
You can’t perform that action at this time.
0 commit comments