Skip to content

Instantly share code, notes, and snippets.

@Tim-Machine
Created May 5, 2014 18:07
Show Gist options
  • Select an option

  • Save Tim-Machine/f3654df442c9d0e999c2 to your computer and use it in GitHub Desktop.

Select an option

Save Tim-Machine/f3654df442c9d0e999c2 to your computer and use it in GitHub Desktop.
<?php
// ...
public function getAvatar( $pid )
{
$userData = Usermeta::where('patientId', $pid)->take(1)->remember(5);
if($userData->count() == 0){
$this->setRandomAvatar($pid);
$this->getAvatar($pid);
}
$userData = $userData->get();
foreach($userData as $user){
return $this->avatarPath.$user->Avatar->fileName;
}
}
/...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment