softici/photo-module

Installs: 42

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:laravel-module

v0.1.5 2020-10-25 16:02 UTC

This package is not auto-updated.

Last update: 2024-04-25 04:59:05 UTC


README

Simple photo module which you can useto upload photos into your project.

It provides Photo model controlled using Services\PhotoService class.

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

Install

php artisan acore:module

php artisan vendor:publish --provider=Modules\Photo\Providers\PhotoServiceProvider

Access photo

Get photo public url:

use Modules\Gallery\Entities\Photo;

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

Get resized photo in blade

use Modules\Gallery\Entities\Photo;

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

Implementing photo upload into your modules

@component('photo::components.add_modal', ['model' => $item, 'action' => 'items::items.photo.store'])@endcomponent