datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
711 B
28 lines
711 B
<?php namespace AdamWathan\EloquentOAuth;
|
|
|
|
class EloquentIdentityStore implements IdentityStore
|
|
{
|
|
public function getByProvider($provider, $providerUser)
|
|
{
|
|
return OAuthIdentity::where('provider', $provider)
|
|
->where('provider_user_id', $providerUser->id)
|
|
->first();
|
|
}
|
|
|
|
public function flush($user, $provider)
|
|
{
|
|
OAuthIdentity::where('user_id', $user->getKey())
|
|
->where('provider', $provider)
|
|
->delete();
|
|
}
|
|
|
|
public function store($identity)
|
|
{
|
|
$identity->save();
|
|
}
|
|
|
|
public function userExists($provider, $providerUser)
|
|
{
|
|
return (bool) $this->getByProvider($provider, $providerUser);
|
|
}
|
|
}
|
|
|