2017 © Pedro Peláez
 

library laravelimageable

Add images to your models. Resizes images

image

beestreams/laravelimageable

Add images to your models. Resizes images

  • Thursday, August 24, 2017
  • by beestreams
  • Repository
  • 1 Watchers
  • 1 Stars
  • 110 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 2 % Grown

The README.md

Package to add Images to models

Usage

  1. Install via composer
  2. If Laravel 5.4 or lower, add service provider Beestreams\LaravelImageable\ImageableProvider::class
  3. run php artisan vendor:publish --tag=config
  4. Migrate database
  5. Include Imageable trait on models
  6. Set upload path on model protected $imagePath = 'example/'
  7. When file is available, add it to model $model->attachImage($file);

When file is added to model, it first persists an Image model to DB it then saves the file to specified path. You can set sizes in config to make several images. These are jobs dispatched to queue. For each image size it makes an additional model. When model is deleted, it also deletes the file. When original model is deleted all related models and files are deleted, (*1)

For method list see Imageable trait or IntegrationTest, (*2)

If you want alt_text and description for your files … support for that is coming, (*3)

TODO: - Get file from url (route and response) - Multiple file types support - SVG support - create failsafe in ResizeImage job. If size does not exist, fail gracefully - Integrationtest is a test-dump. Clean up and refactor - Fix hacky Job handle method - Whats up with all the save methods? - External storage services - Delete all sizes on delete - Create controller for image and refactor routes file - If file directory is empty remove directory on delete, (*4)

Important

There is no validation in this package, please validate your requests before using., (*5)

Vendor publish

If you need to modify migrations, models or traits you can ´vendor:publish´ this package. (not tested), (*6)

The Versions

24/08 2017

dev-master

9999999-dev

Add images to your models. Resizes images

  Sources   Download

MIT

The Requires

 

by Mikael Biström

24/08 2017

1.1.0

1.1.0.0

Add images to your models. Resizes images

  Sources   Download

MIT

The Requires

 

by Mikael Biström

24/08 2017

1.0.2

1.0.2.0

Add images to your models. Resizes images

  Sources   Download

MIT

The Requires

 

by Mikael Biström

23/08 2017

1.0.1

1.0.1.0

Add images to your models. Resizes images

  Sources   Download

MIT

The Requires

 

by Mikael Biström

23/08 2017

1.0.0

1.0.0.0

Add images to your models. Resizes images

  Sources   Download

MIT

The Requires

 

by Mikael Biström

17/08 2017

0.8.2

0.8.2.0

Add images to your models. Resizes images

  Sources   Download

MIT

The Requires

 

by Mikael Biström

17/08 2017

0.8

0.8.0.0

Add images to your models. Resizes images

  Sources   Download

MIT

The Requires

 

by Mikael Biström

17/08 2017

0.8.1

0.8.1.0

Add images to your models. Resizes images

  Sources   Download

MIT

The Requires

 

by Mikael Biström