Created
January 17, 2015 13:09
-
-
Save syossan27/46596bfd15c0f6c4d8f6 to your computer and use it in GitHub Desktop.
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
if ( count(User::firstByAttributes('id', '=', '1')) == 0 ) { | |
// 新規作成処理 | |
$user = new User; | |
$user['hoge'] = 1; | |
$user->save(); | |
} else { | |
// アップデート処理 | |
User::where('id', '=', '1')->update(['hoge' => 1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment