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 model1 extends Eloquent { | |
use common; | |
} |
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 model2 extends Eloquent { | |
use common; | |
} |
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 | |
trait common { | |
// ε ±ιε¦η | |
} |
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
if ( count(User::where('id', '=', '1')->get()) == 0 ) { | |
// ζ°θ¦δ½ζε¦η | |
$user = new User; | |
$user['hoge'] = 1; | |
$user->save(); | |
} else { | |
// γ’γγγγΌγε¦η | |
User::where('id', '=', '1')->update(['hoge' => 1]); | |
} |
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
$user = User::firstOrNew(['id' => '1']); | |
$user['hoge'] = 1; | |
$user->save(); |
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
User::updateOrCreate(['id' => 1], ['hoge' => 1]); |
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
if ( count(User::firstByAttributes('id', '=', '1')) == 0 ) { | |
// ζ°θ¦δ½ζε¦η | |
$user = new User; | |
$user['hoge'] = 1; | |
$user->save(); | |
} else { | |
// γ’γγγγΌγε¦η | |
User::where('id', '=', '1')->update(['hoge' => 1]); | |
} |
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
if ( count(User::firstByAttributes('id', '=', '1')) == 0 ) { | |
// ζ°θ¦δ½ζε¦η | |
$user = new User; | |
$user['hoge'] = 1; | |
$user->save(); | |
} else { | |
// γ’γγγγΌγε¦η | |
User::where('id', '=', '1')->update(['hoge' => 1]); | |
} |
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
if ( is_null(User::firstByAttributes('id', '=', '1')) ) { | |
// ζ°θ¦δ½ζε¦η | |
$user = new User; | |
$user['hoge'] = 1; | |
$user->save(); | |
} else { | |
// γ’γγγγΌγε¦η | |
User::where('id', '=', '1')->update(['hoge' => 1]); | |
} |
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
/* | |
|-------------------------------------------------------------------------- | |
| SMTP Server Password | |
|-------------------------------------------------------------------------- | |
| | |
| Here you may set the password required by your SMTP server to send out | |
| messages from your application. This will be given to the server on | |
| connection so that the application will be able to send messages. | |
| | |
*/ |