]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/User.php
tournament settings
[alttp.git] / app / Models / User.php
index 0c2dcf76b0aaaf307c4591f35dc6d2f618b9019e..ff45c6177c234acddda70e6b62493863fb48d151 100644 (file)
@@ -16,6 +16,24 @@ class User extends Authenticatable
                return $this->role === 'admin';
        }
 
+       public function isApplicant(Tournament $tournament) {
+               foreach ($tournament->applications as $applicant) {
+                       if ($applicant->user_id == $this->id) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       public function isDeniedApplicant(Tournament $tournament) {
+               foreach ($tournament->applications as $applicant) {
+                       if ($applicant->user_id == $this->id) {
+                               return $applicant->denied;
+                       }
+               }
+               return false;
+       }
+
        public function isParticipant(Tournament $tournament) {
                foreach ($tournament->participants as $participant) {
                        if ($participant->user_id == $this->id) {