Answers for "link image public laravel"

PHP
1

laravel upload image to public folder

<?php

if($request->hasFile('image')){
    $image = $request->file('image');
    $image_name = $image->getClientOriginalName();
    $image->move(public_path('/images'),$image_name);

    $image_path = "/images/" . $image_name;
}

?>
Posted by: Guest on September-05-2021
1

how to store an image in laravel directly from url

use Storage;
$url = "http://www.google.co.in/intl/en_com/images/srpr/logo1w.png";
$contents = file_get_contents($url);
$name = substr($url, strrpos($url, '/') + 1);
Storage::put($name, $contents);
Posted by: Guest on June-19-2021

Code answers related to "link image public laravel"

Browse Popular Code Answers by Language