Hey, until now i was able to send a password reminder email, but now i can't, even though i haven't changed anything.
My error is:
Illuminate \ Database \ QueryException
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'email' cannot be null (SQL: insert into `password_reminders` (`email`, `token`, `created_at`) values (, 578ed6b93f4dca82f6e8d070d22022535e72b930, 2014-08- 25 13:01:02))
And you can see that the email address is not in this query, even though lower on the error page there is this
POST Data
email someemail@gmail.com
_token CBE7Qjw5Zav7AcdKoqbJS2MNX4noc4i74n7202r
So, why does this happen?
My controller code is this
public function postRemind()
{
$response = Password::remind(Input::only('email'), function($message){$message->subject('Your new password');});
switch ($response)
{
case Password::INVALID_USER:
return Redirect::route('login')->with('error', Lang::get($response));
case Password::REMINDER_SENT:
return Redirect::route('login')->with('error', Lang::get($response));
}
}
I had a similar problem. My MASTERFUL BOSS (he's looking over my shoulder now) managed to spot the issue...
The method User::getReminderEmail() wasn't set (or rather - was empty). Thus this returns false, which in turns means that validation tries to put null into the DB.
/**
* Get the e-mail address where password reminders are sent.
*
* @return string
*/
public function getReminderEmail()
{
return $this->email;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community