Last active
September 4, 2017 10:09
-
-
Save corean/c71fbdf60acdcfe4a10439faa54cc047 to your computer and use it in GitHub Desktop.
[Laravel] Laravel Eloquent ORM관련 #PHP #Laravel #ORM #Eloquent
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
| //controller에서 패스워드를 인코딩할 필요없이 모델에서 적용 | |
| public function setPasswordAttribute($password) | |
| { | |
| $this->attributes['password'] = bcrypt($password); | |
| } | |
| public function getPasswordAttribute($password) | |
| { | |
| return bcrypt($password); | |
| } |
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
| //Retreive the name, email and password fields | |
| $input = $request->only(['name', 'email', 'password']); | |
| $user->fill($input)->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment