PHP code example of voerro / laravel-file-uploader

1. Go to this page and download the library: Download voerro/laravel-file-uploader 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/ */

    

voerro / laravel-file-uploader example snippets


Voerro\FileUploader\FileUploaderServiceProvider::class,

'FileUploader' => Voerro\FileUploader\FileUploaderFacade::class,

use Voerro\FileUploader\FileUploader;

$path = FileUploader::make($file)->upload();

::make(Illuminate\Http\UploadedFile $file)

::delete(string $filePath, string $storage = 'public')

::isImage($file, $storage = 'public')

->upload(string $path = '', string $storage = 'public')

->uploadAs(string $filename, string $path = '', string $storage = 'public')

->replace(string $oldFilePath, string $path = '', string $storage = 'public')

->replaceAs(string $oldFilePath, string $newFilename, string $path = '', string $storage = 'public')

->downsize(integer $maxWidth, integer $maxHeight)

->fit(integer $width, integer $height, boolean $dontUpsize = false)

FileUploader::make($image)->downsize(200, 200)->replace('old_image_file.jpg');