Skip to content

Instantly share code, notes, and snippets.

@araeuchle
Created January 10, 2018 21:52
Show Gist options
  • Save araeuchle/ac6ee6944d27918f3cc9a1d69222c09b to your computer and use it in GitHub Desktop.
Save araeuchle/ac6ee6944d27918f3cc9a1d69222c09b to your computer and use it in GitHub Desktop.
$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