1. Go to this page and download the library: Download aquinoaldair/storage-image library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aquinoaldair / storage-image example snippets
use AquinoAldair\StorageImage\StorageImage;
$image = "data:image/png;base64.....";
//store image with random 20 character name in Storage disk public (storage/app/public/customFolder)
$file_name = StorageImage::FromBase64($image)->store("custom_folder");
echo $file_name; // "custom_folder/jqmix7a1l6masdGasd7S.jpg"
namespace AquinoAldair\StorageImage\Strategies;
use AquinoAldair\StorageImage\Contract\Image;
class MyCustomClass implements Image
{
protected $file;
public function __construct($file)
{
$this->file = $file;
}
public function store($folder = null)
{
// do something
}
}
$image = "something";
StorageImage::make(new MyCustomClass($image))->store("custom_folder");
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.