Merhaba ,
Şu an basit bir site yazıyorum ve Sentry sistemini kullanmak istemiyorum. Kullanıcı kaydederken Email kaydı olduğunu belirten hata mesajı laravelde nasıl yapılır ? Mesajımda comment yaptığım Catch satırlarını ayarlamak istiyorum. Teşekkür Ederim.
public function postSignup()
{
// Declare the rules for the form validation
$rules = array(
'first_name' => 'required|min:3',
'last_name' => 'required|min:3',
'email' => 'required|email|unique:users',
'email_confirm' => 'required|email|same:email',
'password' => 'required|between:3,32',
'password_confirm' => 'required|same:password',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
try
{
// Register the user
$user = Sentry::register(array(
'first_name' => Input::get('first_name'),
'last_name' => Input::get('last_name'),
'email' => Input::get('email'),
'password' => Input::get('password'),
));
// Redirect to the register page
return Redirect::back()->with('success', Lang::get('auth/message.signup.success'));
}
//catch (Cartalyst\Sentry\Users\UserExistsException $e)
//{
// $this->messageBag->add('email', Lang::get('auth/message.account_already_exists'));
//}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}