# Plank/Laravel-Mediable

Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel 5.

## Features

- Filesystem-driven approach is easily configurable to allow any number of upload directories with different accessibility.
- Many-to-many polymorphic relationships allow any number of media to be assigned to any number of other models without any need to modify the schema.
- Attach media to models with tags, to set and retrieve media for specific purposes, such as `'thumbnail'`, `'featured image'`, `'gallery'` or `'download'`.
- Easily query media and restrict uploads by MIME type, extension and/or aggregate type (e.g. `image` for jpeg, png or gif).

Getting Started

- Installation
- Configuration
  - Disks
  - Validation
  - Aggregate Types
  - Extending functionality

Guides

- Uploading Files
  - Source Files
  - Specifying Destination
  - Specifying Filename
  - Handling Duplicates
  - Validation
  - Handling Exceptions
  - Importing Files
  - Updating Files
- Handling Media
  - Attaching Media
  - Replacing Media
  - Retrieving Media
  - Media Order
  - Checking for the Presence of Media
  - Detaching Media
  - Loading Media
  - Automatic Rehydration
  - Deleting Mediables
- Using Media
  - Media Paths & URLs
  - Querying Media
  - Moving Media
  - Deleting Media
- Aggregate Types
- Artisan Commands