Merge branch 'feature/eloquent_model_detection' into staging
This commit is contained in:
@@ -107,10 +107,6 @@ abstract class Driver {
|
|||||||
*/
|
*/
|
||||||
public function login($token, $remember = false)
|
public function login($token, $remember = false)
|
||||||
{
|
{
|
||||||
// if the token is an Eloquent model
|
|
||||||
// set the token from the id field
|
|
||||||
if ($token instanceof Eloquent) $token = $token->get_key();
|
|
||||||
|
|
||||||
$this->token = $token;
|
$this->token = $token;
|
||||||
|
|
||||||
$this->store($token);
|
$this->store($token);
|
||||||
|
|||||||
@@ -18,6 +18,29 @@ class Eloquent extends Driver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Login the user assigned to the given token.
|
||||||
|
*
|
||||||
|
* The token is typically a numeric ID for the user.
|
||||||
|
*
|
||||||
|
* @param mixed $token
|
||||||
|
* @param bool $remember
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function login($token, $remember = false)
|
||||||
|
{
|
||||||
|
// if the token is an Eloquent model get the primary key
|
||||||
|
if ($token instanceof \Eloquent) $token = $token->get_key();
|
||||||
|
|
||||||
|
$this->token = $token;
|
||||||
|
|
||||||
|
$this->store($token);
|
||||||
|
|
||||||
|
if ($remember) $this->remember($token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempt to log a user into the application.
|
* Attempt to log a user into the application.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user