Last active
December 19, 2018 08:53
-
-
Save devmsh/87606421a126da2942343ec7a0b5784b to your computer and use it in GitHub Desktop.
User.php
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 User{ | |
| public function addNewMobile($mobile): UserMobile | |
| { | |
| $userMobile = new UserMobile(['mobile' => $mobile, 'status' => self::STATUS_VERIFIED]); | |
| if(app()->events->until( | |
| event(new MobileVerifying($userMobile)) !== false | |
| )){ | |
| $userMobile = $this->mobiles()->save($userMobile); | |
| event(new MobileVerified($userMobile)); | |
| return $userMobile; | |
| } | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment