Skip to content

Instantly share code, notes, and snippets.

@yasaryousuf
Created March 12, 2018 09:07
Show Gist options
  • Save yasaryousuf/efaf208826a0ea07930f012854d26239 to your computer and use it in GitHub Desktop.
Save yasaryousuf/efaf208826a0ea07930f012854d26239 to your computer and use it in GitHub Desktop.
laravel-image-validation
$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