legendarydrew / laravel-siteimage
Laravel package for local environment friendly managing of cloud-hosted images.
Requires
- php: ^8.2
- ext-json: *
- cloudinary/cloudinary_php: ^2.6
- intervention/image: ^2.7
- legendarydrew/http-constants: dev-master
Requires (Dev)
- fakerphp/faker: ^1.18
- mmo/faker-images: ^0.9.0
- orchestra/testbench: ^9.7
- phpunit/phpunit: ^10
- rector/rector: ^2.0
This package is auto-updated.
Last update: 2025-04-15 17:25:54 UTC
README
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) SiteImage::rename($old_image_id, $new_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.