Support the ongoing development of Laravel.io →
Requests Input Database

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));
	}
}
Last updated 3 years ago.
0

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;
}
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Joe96 joe96 Joined 28 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.