ianrothmann/laravel-rocket-upload

Back-end handler for file uploads. Designed to complement the Rocket Vue App Framework Multiple File Upload.
7,581 1
Install
composer require ianrothmann/laravel-rocket-upload
Latest Version:0.8.1
PHP:>=5.4.0
License:Apache-2.0
Last Updated:Jul 20, 2019
Links: GitHub  ·  Packagist
Maintainer: ianrothmann

LaravelRocketUpload

A Laravel 5 handler for file uploads with the Rocket Upload Vue component.

Installation

composer require ianrothmann/laravel-rocket-upload

in config/app.php

Service Provider IanRothmann\LaravelRocketUpload\ServiceProviders\RocketUploadServiceProvider::class

Facade

'RocketUpload' =>IanRothmann\LaravelRocketUpload\Facades\RocketUpload::class

Examples

An example of an Image

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();

An example of a file.

return RocketUpload::request($request)
                ->disk('s3') //optional
                ->directory('uploadedfiles')
                ->processWith(function($file_contents){
                     //Do something here
                     return $file_contents;
                  })
                ->handle();

Be careful with ->processWith(), it loads the entire file into memory.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

404,034,618 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

387,976,821 4,658