I have 2 array when one of the array is empty and sortby then it gives empty array
$first = [];
$second = ['created_at'=>2];
$third= [$first , $second];
$res = collect($third)->sortBy('created_at')->first();
dd($res);
if both array have value then it proper run. issue comes when one of array is empty. i need other array which is not empty. Thanks