Created
November 27, 2014 13:43
-
-
Save mtigdemir/b79f1db9354c6ab341e1 to your computer and use it in GitHub Desktop.
Laravel One to One Create
This file contains 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
$user = User::find(10); | |
$profile = $user->UserProfile ?: new UserProfile; | |
$profile->name = 'Steven'; | |
$user->UserProfile()->save($profile); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment