oauth2-server/examples/relational/Model/Users.php
Graham Campbell a1726903b5 CS fixes
2014-12-10 13:10:35 +00:00

26 lines
492 B
PHP

<?php
namespace RelationalExample\Model;
use Illuminate\Database\Capsule\Manager as Capsule;
class Users
{
public function get($username = null)
{
$query = Capsule::table('users')->select(['username', 'password', 'name', 'email', 'photo']);
if ($username !== null) {
$query->where('username', '=', $username);
}
$result = $query->get();
if (count($result) > 0) {
return $result;
}
return;
}
}