Skip to content

Instantly share code, notes, and snippets.

@kamaulynder
Created March 18, 2016 10:17
Show Gist options
  • Save kamaulynder/f538f653b03cf15a9d7a to your computer and use it in GitHub Desktop.
Save kamaulynder/f538f653b03cf15a9d7a to your computer and use it in GitHub Desktop.
<?php
namespace RollCall\Services;
use RollCall\Contracts\Repositories\UsersRepository;
class PasswordGrantVerifier
{
/**
* @var UsersRepository
*/
protected $users;
/**
* @param UsersRepository $users
*/
public function __construct(UsersRepository $users)
{
$this->users = $users;
}
/**
* @param $email
* @param $id
*
* @return bool|mixed
*/
public function verify($email, $id)
{
if ($user = $this->users->find($id)) {
return $user->id;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment