dosarkz/laravel-uploader

Uploading Class for laravel 5
275 2
Install
composer require dosarkz/laravel-uploader
Latest Version:0.2.4
Last Updated:Dec 22, 2017
Links: GitHub  ·  Packagist
Maintainer: dosarkz

laravel-uploader

Laravel 5 image and file uploader with resizer http://image.intervention.io/

Install

composer require dosarkz/laravel-uploader

Add to config/app.php

Provider

Dosarkz\LaravelUploader\Provider\LaravelUploaderServiceProvider::class

Alias

'Uploader' => Dosarkz\LaravelUploader\Facade\LaravelUploaderFacade::class
  

Sample image upload

Uploader::image(uploaded_file, destination, resize, imageWidth, imageHeight, thumbWidth, thumbHeight)
  • @uploaded_file - instance of UploadedFile
  • @destination - the path to the image, 'images/articles', string
  • @resize - A parameter that determines to use compression or not. In the case of using need to fill one of the parameters the resolution of the image, true or false, boolean
  • @imageWidth, @imageHeight - the parameters of the image in pixels, 100, numeric
  • @thumbWidth, @thumbHeight - the parameters of the thumbnail in pixels, 100, numeric
  use Uploader;
  
  $image_uploader  = Uploader::image($request->file('avatar'));
  $image = Image::create([
      'name' => $image_uploader->getFileName(),
      'thumb' => $image_uploader->getThumb(),
      'path' => $image_uploader->getDestination(),
  ]);

Sample file upload

Uploader::file(uploaded_file, destination)
  • @uploaded_file - instance of UploadedFile
  • @destination - the path to the image, 'images/articles', string
use Uploader;
  
 $image_uploader  = Uploader::file($request->file('file'));

  $file = File::create([
      'name' => $image_uploader->getFileName(),
      'path' => $image_uploader->getDestination(),
      'user_id' => auth()->user()->id
  ]);
                        

Related Packages

gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
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