Created
June 6, 2016 22:08
-
-
Save juniorb2ss/60f20622d347891f215e1d11e4a40b88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UserRepository { | |
/** | |
* Create new user in database | |
* @return \App\User User Instance | |
*/ | |
public static function firstOrCreate(){ | |
// logic | |
return User::firstOrCreate([ | |
'github_id', $githubUser->id | |
], ['avatar' => $githubUser->avatar]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment