]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/Tournament.php
option to hide round numbers
[alttp.git] / app / Models / Tournament.php
index a38e9bde591a546975a402e361c4f420fa63be17..96e89b8939358aea1b88acfdfa8f1c89270e86aa 100644 (file)
@@ -21,6 +21,10 @@ class Tournament extends Model
                return $runners;
        }
 
+       public function hasScoreboard() {
+               return $this->type == 'signup-async';
+       }
+
        public function updatePlacement() {
                $runners = [];
                foreach ($this->participants as $p) {
@@ -61,6 +65,10 @@ class Tournament extends Model
        }
 
 
+       public function applications() {
+               return $this->hasMany(Application::class);
+       }
+
        public function participants() {
                return $this->hasMany(Participant::class);
        }
@@ -73,4 +81,12 @@ class Tournament extends Model
                return $this->hasMany(Round::class)->orderBy('number', 'DESC');
        }
 
+
+       protected $casts = [
+               'accept_applications' => 'boolean',
+               'locked' => 'boolean',
+               'no_record' => 'boolean',
+               'show_numbers' => 'boolean',
+       ];
+
 }