legendarydrew/laravel-siteimage

Laravel package for local environment friendly managing of cloud-hosted images.

dev-main 2022-04-05 00:28 UTC

This package is auto-updated.

Last update: 2024-04-05 04:45:55 UTC


README

Latest Version on Packagist Total Downloads

A package for managing cloud-hosted images in a Laravel project.

This was developed to allow local mimicking of Cloudinary-hosted images, instead of using precious (and probably expensive) server bandwidth during development.

Installation

You can install the package via composer:

composer require legendarydrew/laravel-siteimage

Copy configuration file

php artisan vendor:publish --provider="PZL\SiteImage\SiteImageServiceProvider" --tag="config"

Copy placeholder images (for missing images)

php artisan vendor:publish --provider="PZL\SiteImage\SiteImageServiceProvider" --tag="assets"

(or create your own!)

Environment variables

SITE_IMAGE_PROVIDER

LocalImage (default) or CloudinaryImage.

SITE_IMAGE_LOCAL_FOLDER

The folder where locally-hosted images are stored, relative to the public folder (default 'img').

Usage

SiteImage::get($image_id[, $transformation, $format])
SiteImage::approve($image_id)
SiteImage::reject($image_id)
SiteImage::destroy($image_id)
...

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email drew@pzlabs.co instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.