PHP code example of ianrothmann / laravel-rocket-upload
1. Go to this page and download the library: Download ianrothmann/laravel-rocket-upload 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/ */
ianrothmann / laravel-rocket-upload example snippets
return RocketUpload::request($request)
->disk('s3') //optional
->directory('uploadedfiles')
->thumbnail($w,$h,$fit) //$fit=true by default, if false it will resize the picture and not cut off
->maxDimensions($w,$h)
->processImageWith(function(Image $image){
//Intervention Image Object
//Do something here
return $image;
})
->afterUpload(function(File $file){
//Do something with file model here
})
->handle();
return RocketUpload::request($request)
->disk('s3') //optional
->directory('uploadedfiles')
->processWith(function($file_contents){
//Do something here
return $file_contents;
})
->handle();