Created
March 12, 2018 09:07
-
-
Save yasaryousuf/efaf208826a0ea07930f012854d26239 to your computer and use it in GitHub Desktop.
laravel-image-validation
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
$user->image_url = "profile.jpg"; | |
if ($request->hasFile('user_image_url')) { | |
$image = $request->file('user_image_url'); | |
$image_url = time().$image->getClientOriginalName(); | |
$destinationPath = public_path('/profile-images'); | |
$image->move($destinationPath, $image_url); | |
$user->image_url = $image_url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment