2017 © Pedro Peláez
 

library media-upload

Simple and easy AJAX media upload for Laravel

image

triasrahman/media-upload

Simple and easy AJAX media upload for Laravel

  • Friday, June 12, 2015
  • by triasrahman
  • Repository
  • 3 Watchers
  • 37 Stars
  • 441 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 6 Versions
  • 5 % Grown

The README.md

Simple and Easy AJAX Media Upload for Laravel

Build Status Total Downloads Latest Stable Version License, (*1)

This is a package to make AJAX upload process easy and simple! Enhance your customer experience and improve your system performance., (*2)

SEE DEMO

Requirements

Installation

Require this package with composer:, (*3)

composer require triasrahman/media-upload

After updating composer, add the ServiceProvider to the providers array in config/app.php, (*4)

'providers' => [
    //  ...
    'Triasrahman\MediaUpload\MediaUploadServiceProvider',
]

Copy the package config to your local config with the publish command:, (*5)

php artisan vendor:publish

Usage

Your HTML form, (*6)


<input type="file" name="file"> <img clas="preview" src="">

Using jQuery AJAX, (*7)


$('input[name=file]').change(function() { // AJAX Request $.post( '/media-upload', {file: $(this).val()} ) .done(function( data ) { if(data.error) { // Log the error console.log(error); } else { // Change the image attribute $( 'img.preview' ).attr( 'src', data.path ); } }); });

Configurations

Edit media-upload.php for more configurations., (*8)

/*
 |--------------------------------------------------------------------------
 | Upload Types
 |--------------------------------------------------------------------------
 |
 | It's the flexibility of this package. You can define the type of upload
 | file methods. For example, you want to upload for profile picture,
 | article post, background, etc. Here is 
 |
 */

'types' => [
    // ... put your custom type ...

    'profile' => [
        'middleware' => 'auth',
        'format' => 'image',
        'image' => [
            'fit' => [400, 400],
            'thumbs' => [
                'small' => [50, 50],
                'medium' => [100, 100],
            ]
        ],
        'save_original' => true,
    ],

    'profile-cover' => [
        'middleware' => 'auth',
        'format' => 'image',
        'image' => [
            'fit' => [1200, 400],
        ],
        'multiple' => false,
    ],

    'media' => [
        'middleware' => 'auth',
        'format' => 'image|video|audio',
        'image' => [
            'thumbs' => [
                'small' => [50, 50],
                'medium' => [100, 100],
            ]
        ],
        'multiple' => true,
    ],

],   

Front-end Integration

Coming Soon, (*9)

License

Laravel Media Upload is licensed under the MIT License., (*10)

Copyright 2015 Trias Nur Rahman, (*11)

The Versions

12/06 2015

dev-master

9999999-dev

Simple and easy AJAX media upload for Laravel

  Sources   Download

MIT

The Requires

 

by Trias Nur Rahman

laravel file ajax upload image media

12/06 2015

v1.0.3

1.0.3.0

Simple and easy AJAX media upload for Laravel

  Sources   Download

MIT

The Requires

 

by Trias Nur Rahman

laravel file ajax upload image media

01/06 2015

dev-demo

dev-demo

The Laravel Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework

26/05 2015

v1.0.2

1.0.2.0

Simple and easy AJAX media upload for Laravel

  Sources   Download

MIT

The Requires

 

by Trias Nur Rahman

laravel file ajax upload image media

26/05 2015

v1.0.1

1.0.1.0

Simple and easy AJAX media uploader for Laravel

  Sources   Download

MIT

The Requires

 

by Trias Nur Rahman

laravel file ajax image media uplioad

24/05 2015

v1.0.0

1.0.0.0

Simple and easy AJAX media uploader for Laravel

  Sources   Download

MIT

The Requires

 

by Trias Nur Rahman

laravel file ajax image media uplioad