Inheritance: extends Illuminate\Database\Eloquent\Model
示例#1
0
 public function register($user)
 {
     if ($this->isSignedUp($user)) {
         return;
     }
     //sanity check: we shouldn't be touching users once the tournament is already in action.
     if ($this->isTournamentRunning()) {
         return;
     }
     $reg = new TournamentRegistration();
     $reg->user()->associate($user);
     $this->registrations()->save($reg);
 }