+ public function isRunner(Tournament $tournament) {
+ foreach ($tournament->participants as $participant) {
+ if ($participant->user_id == $this->id) {
+ return in_array('runner', $participant->roles);
+ }
+ }
+ return false;
+ }
+
+ public function isTournamentAdmin(Tournament $tournament) {
+ foreach ($tournament->participants as $participant) {
+ if ($participant->user_id == $this->id) {
+ return in_array('admin', $participant->roles);
+ }
+ }
+ return false;
+ }
+
+ public function participation() {
+ return $this->hasMany(Participant::class);
+ }
+