8000 GitHub - joaquin03/uploadable: A trait to automatically handle file uploads for Laravel models.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A trait to automatically handle file uploads for Laravel models.

Notifications You must be signed in to change notification settings

joaquin03/uploadable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uploadable

A trait to automatically handle file uploads for Laravel models.

Example Usage

Here's the package integrated into a bog-standard Laravel 5 model.

use MikeFrancis\Uploadable\Uploadable;
use Illuminate\Database\Eloquent\Model;

class Post extends Model {

  use Uploadable;

  protected $uploadables = ['featured_image'];

}

Let's break it down. First we include the trait we're going to take advantage:

use MikeFrancis\Uploadable\UploadableTrait;

Then in our model we use the trait:

use UploadableTrait;

Our model's $uploadables is an array of file input name attributes which you'd like to be automatically handled by the trait.

It's as simple as that. Standby for more features coming soon!

About

A trait to automatically handle file uploads for Laravel models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%
0