michaeldojcar/laravel-photo

Laravel photo module

Downloads

39

Stars

0

Version

v0.2.2

Photo module

Latest Stable Version Total Downloads Latest Unstable Version License

Simple photo module which you can use to upload and work with photos in your project.

It provides Photo model controlled using Services\PhotoService class.

Photos are stored in Laravel public storage and their metadata in database (table photos).

Install

php artisan vendor:publish --provider=MichaelDojcar\LaravelPhoto\Providers\PhotoServiceProvider

Access photo

Get photo public url:

use MichaelDojcar\LaravelPhoto\Models\Photo;

$photo = Photo::findOrFail(1);
$photo->url();

Get resized photo URL

You can generate any size of your Photos immediately in blade template.

use MichaelDojcar\LaravelPhoto\Models\Photo;

$photo = Photo::findOrFail(1);
$photo->resize(250, 120); // Specify width and height
michaeldojcar

Author

michaeldojcar