Skip to content

Commit

Permalink
Fix 'remember_me' column not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
srmklive committed Dec 1, 2016
1 parent 4c80c6e commit e798177
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Illuminate/Auth/Authenticatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

trait Authenticatable
{
/**
* Variable containing "remember me" column name.
*
* @var string
*/
protected $remember_column = 'remember_token';

/**
* Get the name of the unique identifier for the user.
*
Expand Down Expand Up @@ -41,7 +48,9 @@ public function getAuthPassword()
*/
public function getRememberToken()
{
return $this->{$this->getRememberTokenName()};
if (! empty($this->getRememberTokenName())) {
return $this->{$this->getRememberTokenName()};
}
}

/**
Expand All @@ -52,7 +61,9 @@ public function getRememberToken()
*/
public function setRememberToken($value)
{
$this->{$this->getRememberTokenName()} = $value;
if (! empty($this->getRememberTokenName())) {
$this->{$this->getRememberTokenName()} = $value;
}
}

/**
Expand All @@ -62,6 +73,6 @@ public function setRememberToken($value)
*/
public function getRememberTokenName()
{
return 'remember_token';
return $this->remember_column;
}
}

0 comments on commit e798177

Please sign in to comment.