Open ravigupta112 opened 9 years ago
did you ever find a solution to this problem?
did you ever find a solution to this problem?
Do $user->toArray() or something, but don't try to serialise the entire user object - that won't work.
It doesn't work because you end up trying to serialise the entire laravel service container and all resolved objects, lol.
I'm just calling the password reset method.. will give you more details when I'm in front of a computer.
@GrahamCampbell I'm only calling Confide::forgotPassword(Input::get('email'))
. Using version 4.2.
I think this happens because $lang = $this->app['translator'];
returns object(Polyglot\Services\Lang)
. It seems like polyglot can't be serialized that easily..
A workaround would be easy, I just replace the IoC with Lang::get
to avoid polyglot and everything is fine, but that's not really what I want to do.
protected function sendEmail($user, $token)
{
$config = $this->app['config'];
$this->app['mailer']->queueOn(
$config->get('confide::email_queue'),
$config->get('confide::email_reset_password'),
compact('user', 'token'),
function ($message) use ($user, $token) {
$message
->to($user->email, $user->username)
->subject(Lang::get('confide::confide.email.password_reset.subject'));
}
);
}
Compare to: https://github.com/Zizaco/confide/blob/master/src/Confide/EloquentPasswordService.php#L169-L184
When i submit the forgot password form i getting the "Serialization of 'Closure' is not allowed" Exceptio
after debugging i find the code from there error is reproduced
// File : confide/src/Confide/EloquentPasswordService.php
// Code: protected function sendEmail($user, $token) { $config = $this->app['config']; $lang = $this->app['translator'];