From 9cd0234665ea66dff172d94b9c1b4cb61b1d25b1 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Sun, 21 Jun 2020 17:58:23 +0100 Subject: Improve robustness of all scripts and add more to sync command --- app/Rugby/Model/Match.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'app/Rugby/Model/Match.php') 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'); } - } -- cgit v1.2.3