laravel sortby varchar date

46

laravel sortby varchar date -

$items = DB::table("mytable")->where('userId','=',$userId)->orderByRaw("DATE_FORMAT('d-m-Y',startDate), ASC")->get();

laravel collection sort by date -

$sorted = $transaction->sortBy(function($col)
{
    return $col;
})->values()->all();

Comments

Submit
0 Comments