name)); $out = $name_parts->map( function ($value) { if ($this->isDate($value)) { return ['date', $value]; } return ['string', $value]; } ); return $out; } public function matches() { return $this->belongsToMany(Match::class); } }