public function signup() { if ($this->validate()) { $user = new GymAdmin(); $user->username = $this->username; $user->email = $this->email; $user->setPassword($this->password); $user->generateAuthKey(); $user->generateAccessToken(); if ($user->save()) { return $user; } } return null; }