File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ public function distinct($column = false)
268
268
*/
269
269
public function orderBy ($ column , $ direction = 'asc ' )
270
270
{
271
- $ this ->orders [$ column ] = ($ direction == 'asc ' ? 1 : -1 );
271
+ $ this ->orders [$ column ] = (strtolower ( $ direction) == 'asc ' ? 1 : -1 );
272
272
273
273
return $ this ;
274
274
}
Original file line number Diff line number Diff line change @@ -142,6 +142,9 @@ public function testOrder()
142
142
$ user = User::whereNotNull ('age ' )->orderBy ('age ' , 'asc ' )->first ();
143
143
$ this ->assertEquals (13 , $ user ->age );
144
144
145
+ $ user = User::whereNotNull ('age ' )->orderBy ('age ' , 'ASC ' )->first ();
146
+ $ this ->assertEquals (13 , $ user ->age );
147
+
145
148
$ user = User::whereNotNull ('age ' )->orderBy ('age ' , 'desc ' )->first ();
146
149
$ this ->assertEquals (37 , $ user ->age );
147
150
}
You can’t perform that action at this time.
0 commit comments