Download the PHP package reliqarts/laravel-guided-image without Composer
On this page you can find all versions of the php package reliqarts/laravel-guided-image. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-guided-image
Laravel Guided Image
Guided Image is an image utility package for Laravel based on Intervention Image.
Key Features
- On-the-fly image resizing
- On-the-fly thumbnail generation
- Image uploading
- Smart image reuse; mitigating against double uploads and space resource waste.
Guided Image can be integrated seamlessly with your existing image model.
Guided Routes
The package provides routes for generating resized/cropped/dummy images.
- Routes are configurable you you may set any middleware and prefix you want.
- Generated images are cached to disk to avoid regenerating frequently accessed images and reduce overhead.
Image file reuse
For situations where different instances of models use the same image.
- The package provides a safe removal feature which allows images to be detached and only deleted from disk if not being used elsewhere.
- An overridable method is used to determine when an image should be considered safe to delete.
Installation & Usage
Installation
Install via composer; in console:
or require in composer.json:
then run composer update
in your terminal to pull it in.
Finally, publish package resources and configuration:
You may opt to publish only configuration by using the guidedimage-config
tag:
Setup
Set the desired environment variables so the package knows your image model, controller(s), etc.
Example environment config:
These variables, and more are explained within the config file.
And... it's ready! :ok_hand:
Usage
To use Guided Image you must do just that from your Image model. :smirk:
Implement the ReliqArts\GuidedImage\Contract\GuidedImage
contract and use the ReliqArts\GuidedImage\Concern\Guided
trait, e.g:
See example here.
Implement the ReliqArts\GuidedImage\Contract\ImageGuide
contract and use the ReliqArts\GuidedImage\Concern\Guide
trait from your ImageController, e.g:
See example here.
Features
Safely Remove Image (dissociate & conditionally delete the image)
An guided image instance is removed by calling the remove method. e.g:
$force
is optional and is false
by default.
Link Generation
You may retrieve guided links to resized or cropped images like so:
NB: In the above example _
resolves to null
.
Have a look at the GuidedImage contract for more info on model functions.
For more info on controller functions see the ImageGuide contract.
Routes
Your actually routes will depend heavily on your custom configuration. Here is an example of what the routes may look like:
All versions of laravel-guided-image with dependencies
illuminate/support Version ^11.1
intervention/image Version ^3.7
reliqarts/laravel-common Version ^8.0
ext-json Version *
ext-fileinfo Version *
anhskohbo/no-captcha Version @dev