Cartalyst\Sentinel\Sentinel::registerAndActivate PHP Method

registerAndActivate() public method

Registers and activates the user.
public registerAndActivate ( array $credentials ) : Cartalyst\Sentinel\Users\UserInteface | boolean
$credentials array
return Cartalyst\Sentinel\Users\UserInteface | boolean
    public function registerAndActivate(array $credentials)
    {
        return $this->register($credentials, true);
    }

Usage Example

 public function postRegister(CredentialsRequest $request)
 {
     if ($user = $this->sentinel->registerAndActivate($this->getRequestData($request))) {
         $this->sentinel->loginAndRemember($user);
         $this->setResponseData($user->toArray());
     } else {
         $this->setErrorData("Can't create user");
     }
     return $this->responseJson();
 }
All Usage Examples Of Cartalyst\Sentinel\Sentinel::registerAndActivate