lloricode/laravel-uploader

This package is abandoned and no longer maintained. The author suggests using the spatie/laravel-medialibrary package instead.

Laravel Uploader

v1.0.4 2018-11-29 00:25 UTC

This package is auto-updated.

Last update: 2019-10-14 23:14:40 UTC


README

Latest Version on Packagist Build Status Total Downloads

Install via composer.

composer require lloricode/laravel-uploader

Usage

Model

<?php

// ....

use Lloricode\LaravelUploader\Contract\UploaderContract; // <--------  add
use Lloricode\LaravelUploader\UploaderOptions; // <--------  add
use Lloricode\LaravelUploader\Traits\UploaderTrait; // <--------  add

class Product extends Model implements UploaderContract // <--------  add
{
    use UploaderTrait; // <--------  add

    public function uploaderRules() :UploaderOptions // <--------  add
    {
        return UploaderOptions::create()
            ->fileNamePrefix('file-')
            ->disk('local') // any disk in config/filesystems.disk
            ->maxSize(20000000); // byte in decimal = 20mb
    }

// ...