Created
November 14, 2018 17:52
-
-
Save leonardopinho/e32a67112098eb077ea80967d88d74fc to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* saveOriginalPhoto | |
* @param Request $request | |
* @param $sub_path | |
* @return string | |
*/ | |
public static function saveOriginalPhoto(Request $request, $sub_path) | |
{ | |
$File = $request->file('image'); | |
$real_name = md5(rand(11111, 99999)) . '_' . time() . '.jpg'; | |
$destination_path = public_path($sub_path); | |
$res = $File->move($destination_path, $real_name); | |
return $sub_path . '/' . $res->getFileName(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment