Created
January 10, 2018 21:47
-
-
Save araeuchle/1c63c17329eaaa38f8c73ff6fedfeef7 to your computer and use it in GitHub Desktop.
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
| // File Upload in OSSN: | |
| $file->owner_guid = $user->guid; | |
| $file->type = 'object'; | |
| $file->subtype = 'verify'; | |
| $file->setFile('passport-front'); | |
| $file->setPath('verify/'); | |
| $file->setExtension(array( | |
| 'jpg', | |
| 'png', | |
| 'jpeg', | |
| 'gif' | |
| )); | |
| $lastGuid = $file->addFile(); | |
| $foxVerification = new \Entity\FoxVerification(); | |
| $currentVerification = $foxVerification->getCurrentVerification(); | |
| $foxVerification->passportFrontPath($currentVerification->id, $lastGuid); | |
| if ($currentVerification->passport_type == 'id') { | |
| $url = 'verify/passport-back'; | |
| } else { | |
| $url = 'verify/user-face'; | |
| } | |
| redirect($url); | |
| // File Upload in Laravel: | |
| $this->validate($request, [ | |
| 'frontFile' => 'required|mimes:jpg,jpeg,jpe,png,gif' | |
| ]); | |
| $user = $request->user(); | |
| $path = $request->file('frontFile')->store(sprintf('verfication/%s', $user->id)); | |
| $verification = Verification::where('user_id', $user->id)->first(); | |
| $verificationFile = new VerificationFile(); | |
| $verificationFile->verification_id = $verification->id; | |
| $verificationFile->type = VerificationFile::TYPE_PASSPORT_FRONT; | |
| $verificationFile->path = $path; | |
| $verificationFile->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment