summaryrefslogtreecommitdiff
path: root/app/Rugby/Model/Match.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2020-06-21 17:58:23 +0100
committerFbenas <philbeansburton@gmail.com>2020-06-21 17:58:23 +0100
commit9cd0234665ea66dff172d94b9c1b4cb61b1d25b1 (patch)
tree9cb5d13acbf3c5bb8c842620ceb8a104b41babb7 /app/Rugby/Model/Match.php
parent8d6e8b306d7836e4075a13ad98617bfe5afaa1a0 (diff)
Improve robustness of all scripts and add more to sync commandHEADmaster
Diffstat (limited to 'app/Rugby/Model/Match.php')
-rw-r--r--app/Rugby/Model/Match.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/Rugby/Model/Match.php b/app/Rugby/Model/Match.php
index 58a3dd9..38d58d8 100644
--- a/app/Rugby/Model/Match.php
+++ b/app/Rugby/Model/Match.php
@@ -47,14 +47,14 @@ class Match extends Model
return $video->getUrl();
}
- public function homeTeam()
+ public function getHomeTeam()
{
- return $this->teams()->wherePivot('is_home', '=', true);
+ return $this->teams()->wherePivot('is_home', '=', true)->first();
}
- public function awayTeam()
+ public function getAwayTeam()
{
- return $this->teams()->wherePivot('is_home', '=', false);
+ return $this->teams()->wherePivot('is_home', '=', false)->first();
}
public function tournaments()
@@ -66,5 +66,4 @@ class Match extends Model
{
return $this->hasMany(Video::class, 'match_id');
}
-
}