Answers for "how to link image files in laravel"

PHP
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
0

upload image in laravel

<?php

  

use IlluminateSupportFacadesRoute;

  

use AppHttpControllersImageUploadController;

  

  

Route::get('image-upload', [ ImageUploadController::class, 'imageUpload' ])->name('image.upload');

Route::post('image-upload', [ ImageUploadController::class, 'imageUploadPost' ])->name('image.upload.post');
Posted by: Guest on January-10-2022

Code answers related to "how to link image files in laravel"

Browse Popular Code Answers by Language