ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

reminderExpired function throwing 'Trying to get property of non-object' #49

Closed bitscraps closed 9 years ago

bitscraps commented 10 years ago

When using the password reminder functionality i'm getting an error which is caused by the reminderExpired function in DatabaseReminderRepositry.php. Line 296 users $reminder->created_at to compare the expiry time. However reminder appears to be an array and not an object.

I'm able to access it using $reminder["created_at"]

ollieread commented 10 years ago

Are you using the default Reminder service? The DatabaseReminderRepository in my package only has 183 lines.

bitscraps commented 10 years ago

Hi, sorry not sure where line 296 came from i meant line 110 the first line of this function

protected function reminderExpired($reminder)
{
    $createdPlusHour = strtotime($reminder->created_at) + $this->expires;

    return $createdPlusHour < $this->getCurrentTime();
}
ollieread commented 10 years ago

By default that should always return an object, and having checked and attempted to recreate, I cannot recreate it. I imagine this is something to do with your configuration, namely because after looking at the default DatabaseReminderRepository I see that it does the same thing.

Do you have database.fetch set to something other than PDO::FETCH_CLASS?