From 8d6e8b306d7836e4075a13ad98617bfe5afaa1a0 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Sat, 20 Jun 2020 21:07:45 +0100 Subject: Add new scripts for youtube downloading and syncing with existing matches --- app/Rugby/Model/Team.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/Rugby/Model/Team.php') diff --git a/app/Rugby/Model/Team.php b/app/Rugby/Model/Team.php index 2582f33..2dbfea6 100644 --- a/app/Rugby/Model/Team.php +++ b/app/Rugby/Model/Team.php @@ -2,12 +2,15 @@ namespace App\Rugby\Model; +use App\Rugby\Concerns\Matchable; use Illuminate\Database\Eloquent\Model; use App\Rugby\Model\Match; class Team extends Model { + use Matchable; + protected $table = 'teams'; protected $fillable = ['name']; @@ -31,4 +34,17 @@ class Team extends Model { return $this->name ?: ''; } + + public function matchableFilters() + { + $name_parts = collect(explode(' ', $this->name)); + + $out = $name_parts->map( + function ($value) { + return ['string', $value]; + } + ); + + return $out; + } } -- cgit v1.2.3