I understand your problem.
That is a One-to-One relationship.
BUT, using hasOne is wrong. It would be right if you hadn't any foreign keys in your match table, but istead in your team table (match_id). You have to use belognsTo instead. This means that the foreign key is in the table of the current model.
The relationship is correct, but you are looking from the wrong side.
How are your relationships defined in your model? Could you post that here?
From my understanding, your Team model should have a "belongsTo" relation towards Match, as you don't want to have a match_id column in your Team.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community