Last active
January 4, 2016 01:19
-
-
Save ollieread/8547632 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// original | |
return array( | |
'driver' => 'eloquent', | |
'model' => 'User', | |
'table' => 'users', | |
'reminder' => array( | |
'email' => 'emails.auth.reminder', | |
'table' => 'password_reminders', | |
'expire' => 60, | |
), | |
); | |
// new | |
return array( | |
'multi' => array( | |
'account' => array( | |
'driver' => 'eloquent', | |
'model' => 'Account' | |
), | |
'user' => array( | |
'driver' => 'database', | |
'table' => 'users' | |
) | |
), | |
'reminder' => array( | |
'email' => 'emails.auth.reminder', | |
'table' => 'password_reminders', | |
'expire' => 60, | |
), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"require": { | |
"ollieread/multiauth": "dev-master" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Auth::account()->attempt(array( | |
'email' => $attributes['email'], | |
'password' => $attributes['password'], | |
)); | |
Auth::user()->attempt(array( | |
'email' => $attributes['email'], | |
'password' => $attributes['password'], | |
)); | |
Auth::account()->check(); | |
Auth::user()->check(); | |
// This is an extra method I added in, to avoid having to do things like Auth::user()->user() | |
Auth::user()->get(); | |
// This is a cool little method to sign in as another user type, while signed in via a different one | |
Auth::admin()->impersonate('user', 1, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment