i have two tables:
Matches:
id round league_id home_team_id away_team_id match_date
Scores:
id match_id home_team_score away_team_score created_at updated_at
How to get latest team match, which have record in table 'scores', for exmpl:
need to get last match where team_id = 1
with this i get all matches of this team, but i need only the last,and where has record in scores table:
$lastMatch = Match::where('away_team_id', '=', '1')
->orWhere('home_team_id', '=', '1')
->get();