im trying to get closest upcoming match to today. But with code i write, i get latest created record.
This is my code:
$upcomingMatch = Match::leftjoin('scores', 'matches.id', '=', 'scores.match_id')
->where(function ($where)
{
$where->where('matches.away_team_id', '=', '1')
->orWhere('matches.home_team_id', '=', '1');
})
->whereNull('scores.id')
->latest('matches.match_date')
->first();
how can i change code, which find date closest to today.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3bRdeKx
via IFTTT
Aucun commentaire:
Enregistrer un commentaire