summaryrefslogtreecommitdiff
path: root/app/Rugby/Model/Team.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2020-06-20 21:07:45 +0100
committerFbenas <philbeansburton@gmail.com>2020-06-20 21:07:45 +0100
commit8d6e8b306d7836e4075a13ad98617bfe5afaa1a0 (patch)
tree99c44e28da231cac0d9e513aabc1ee0768972426 /app/Rugby/Model/Team.php
parent897b68ac107f2fb0d4dc1d31ce96ce24c862eb27 (diff)
Add new scripts for youtube downloading and syncing with existing matches
Diffstat (limited to 'app/Rugby/Model/Team.php')
-rw-r--r--app/Rugby/Model/Team.php16
1 files changed, 16 insertions, 0 deletions
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;
+ }
}