Moved creating user to static method of the model

This commit is contained in:
Alexander Makarov
2014-02-04 13:31:26 +04:00
parent b8f14b06d5
commit 5d7e7f4d91
2 changed files with 13 additions and 4 deletions

View File

@ -41,10 +41,7 @@ class SignupForm extends Model
public function signup()
{
if ($this->validate()) {
$user = User::create($this->attributes);
if ($user->save()) {
return $user;
}
return User::create($this->attributes);
}
return null;
}