X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FTournament.php;h=6f0feb1237db7a8693c20bf7e73e7c44f62e3fa7;hb=212561cf1c6724b52c490104f5a2b4c3418b1c62;hp=a38e9bde591a546975a402e361c4f420fa63be17;hpb=d32516335ea2534e15256c948e9c38d3de40794b;p=alttp.git diff --git a/app/Models/Tournament.php b/app/Models/Tournament.php index a38e9bd..6f0feb1 100644 --- a/app/Models/Tournament.php +++ b/app/Models/Tournament.php @@ -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,11 @@ class Tournament extends Model return $this->hasMany(Round::class)->orderBy('number', 'DESC'); } + + protected $casts = [ + 'accept_applications' => 'boolean', + 'locked' => 'boolean', + 'no_record' => 'boolean', + ]; + }