2017 © Pedro Peláez
 

library laravel-mediable

A package for easily uploading and attaching media files to models with Laravel

image

plank/laravel-mediable

A package for easily uploading and attaching media files to models with Laravel

  • Friday, July 6, 2018
  • by frasmage
  • Repository
  • 21 Watchers
  • 371 Stars
  • 30,738 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 54 Forks
  • 15 Open issues
  • 40 Versions
  • 19 % Grown

The README.md

Laravel-Mediable

Coveralls StyleCI Packagist, (*1)

Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel., (*2)

Features

  • Filesystem-driven approach is easily configurable to allow any number of upload directories with different accessibility. Easily restrict uploads by MIME type, extension and/or aggregate type (e.g. image for JPEG, PNG or GIF).
  • Many-to-many polymorphic relationships allow any number of media to be assigned to any number of other models without any need to modify their schema.
  • Attach media to models with tags, in order to set and retrieve media for specific purposes, such as 'thumbnail', 'featured image', 'gallery' or 'download'.
  • Integrated support for integration/image for manipulating image files to create variants for different use cases.

Example Usage

Upload a file to the server, and place it in a directory on the filesystem disk named "uploads". This will create a Media record that can be used to refer to the file., (*3)

$media = MediaUploader::fromSource($request->file('thumb'))
    ->toDestination('uploads', 'blog/thumbnails')
    ->upload();

Attach the Media to another eloquent model with one or more tags defining their relationship., (*4)

$post = Post::create($this->request->input());
$post->attachMedia($media, ['thumbnail']);

Retrieve the media from the model by its tag(s)., (*5)

$post->getMedia('thumbnail')->first()->getUrl();

Installation

Add the package to your Laravel app using composer, (*6)

composer require plank/laravel-mediable

Register the package's service provider in config/app.php. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled., (*7)

'providers' => [
    ...
    Plank\Mediable\MediableServiceProvider::class,
    ...
];

The package comes with a Facade for the image uploader, which you can optionally register as well. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled., (*8)

'aliases' => [
    ...
    'MediaUploader' => Plank\Mediable\MediaUploaderFacade::class,
    ...
]

Publish the config file (config/mediable.php) of the package using artisan., (*9)

php artisan vendor:publish --provider="Plank\Mediable\MediableServiceProvider"

Run the migrations to add the required tables to your database., (*10)

php artisan migrate

Documentation

Read the documentation here., (*11)

License

This package is released under the MIT license (MIT)., (*12)

About Plank

Plank is a web development agency based in Montreal, Canada., (*13)

The Versions

06/07 2018

dev-master

9999999-dev

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

06/07 2018

2.7.3

2.7.3.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

04/07 2018

2.7.2

2.7.2.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

05/06 2018

2.7.1

2.7.1.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

11/05 2018

2.7.0

2.7.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

11/03 2018

2.6.2

2.6.2.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

05/03 2018

3.0.x-dev

3.0.9999999.9999999-dev

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

20/02 2018

2.6.1

2.6.1.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

13/02 2018

2.6.0

2.6.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

13/02 2018

dev-analysis-z4Db9N

dev-analysis-z4Db9N

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

30/08 2017

2.5.0

2.5.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

18/08 2017

dev-analysis-zdWpDv

dev-analysis-zdWpDv

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

18/08 2017

2.4.8

2.4.8.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

04/05 2017

2.4.7

2.4.7.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

04/05 2017

2.4.6

2.4.6.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

04/05 2017

2.4.5

2.4.5.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

08/03 2017

2.4.4

2.4.4.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

15/02 2017

2.4.3

2.4.3.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

13/02 2017

2.4.2

2.4.2.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

13/02 2017

dev-develop

dev-develop

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

30/12 2016

2.4.1

2.4.1.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

10/12 2016

2.4.0

2.4.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

17/11 2016

2.3.0

2.3.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

13/11 2016

2.2.3

2.2.3.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

07/10 2016

2.2.2

2.2.2.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

05/10 2016

2.2.1

2.2.1.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

30/09 2016

2.2.0

2.2.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

25/09 2016

2.1.0

2.1.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

17/09 2016

2.0.0

2.0.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

16/08 2016

1.1.1

1.1.1.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

14/08 2016

1.1.0

1.1.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

12/08 2016

1.0.1

1.0.1.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

04/08 2016

1.0.0

1.0.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

25/07 2016

0.3.0

0.3.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

21/07 2016

0.2.0

0.2.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

21/07 2016

0.1.4

0.1.4.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

21/07 2016

0.1.3

0.1.3.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

20/07 2016

0.1.2

0.1.2.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

laravel eloquent image uploader media

20/07 2016

0.1.1

0.1.1.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

eloquent image uploader media

20/07 2016

0.1.0

0.1.0.0

A package for easily uploading and attaching media files to models with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sean Fraser

eloquent image uploader media