Esempio n. 1
0
/**
 * Get User Object
 * @param  [type] $id [description]
 * @return [type]     [description]
 */
function getUser($id)
{
    return User::with('info')->whereId($id)->firstOrFail();
}
Esempio n. 2
0
 /**
  * Fetch user
  * (You can extract this to repository method)
  *
  * @param $username
  * @return mixed
  */
 public function getUserByUsername($username)
 {
     return User::with('info')->whereUsername($username)->firstOrFail();
 }