sorry for newbie question. I want to get from table specific columns, order them by date and extract only 150 rows. I tried a lot of combinations. But i dont get the point how should it work:
public function get()
{
Excel::create('Bids-' . date("Y/m/d"), function($excel) {
$excel->sheet('Favourites', function($sheet) {
$comments = Comment::select('auction_name','bid','lot_date','company', 'model_name_en', 'body','grade_en', 'mileage_num', 'model_year_en', 'start_price_en')->sortBy("lot_date", 'desc')->take(150)->get();
$sheet->fromModel($comments);
});
})->download('xls');
}
Please, can some one explain me what im doing wrong, why sortBy dont want to work?