Download the PHP package povly/moonshine-intervention-image without Composer

On this page you can find all versions of the php package povly/moonshine-intervention-image. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package moonshine-intervention-image

MoonShine Intervention Image Field

⚠️ This package is no longer maintained.

Use these two packages instead:


Image optimization and WebP/AVIF conversion field for MoonShine using intervention/image.

Installation

The package requires intervention/image and intervention/image-laravel. If not already installed:

Publish the config (optional):

Requirements

Basic Usage

Watermark

Available Positions

Position Description
top-left Top left corner
top Top center
top-right Top right corner
left Left center
center Center
right Right center
bottom-left Bottom left corner
bottom Bottom center
bottom-right Bottom right corner (default)
custom Custom X/Y coordinates

Image Watermark

Text Watermark

Disable Watermark Per Field

Global Watermark via Config

Configure watermarks globally for all images:

Or via .env:

Offset Behavior

Offsets work relative to the position: Position offset_x positive offset_y positive
top-left Moves right Moves down
top Moves right Moves down
top-right Moves left Moves down
left Moves right Moves down
center Moves right Moves down
right Moves left Moves down
bottom-left Moves right Moves up
bottom Moves right Moves up
bottom-right Moves left Moves up

Example - move watermark away from edges:

Queue Processing

Process images in the background using Laravel queues. Useful for handling large images or multiple uploads without blocking the user request.

Enable via Config

Enable via Field Method

Queue Job

The ProcessImage job handles:

Optimize Command

The moonshine:image:optimize Artisan command allows you to batch-optimize existing images. It scans a storage disk (or specific paths), applies optimization, and optionally generates WebP/AVIF conversions — using settings from your config.

Basic Usage

Queue vs Sync

By default, the command reads moonshine-intervention-image.queue.enabled from config. Override with flags:

Apply a Preset

Override Options

All processing options can be overridden per run:

Combined Example

Config

exclude_paths is an array of directory paths that will be skipped during full-disk scans:

Command Options

Option Description
paths Specific file or directory paths to optimize (positional, optional)
--disk= Storage disk to scan (default: from config)
--preset= Apply a named preset from config
--queue Force queue processing
--sync Force synchronous processing
--quality= Override quality for original image (1-100)
--quality-webp= Override quality for WebP (1-100)
--quality-avif= Override quality for AVIF (1-100)
--generate-webp Generate WebP versions
--no-webp Disable WebP generation
--generate-avif Generate AVIF versions
--no-avif Disable AVIF generation
--strip-metadata Strip EXIF/IPTC metadata
--max-width= Maximum image width (keeps aspect ratio)
--max-height= Maximum image height (keeps aspect ratio)

Methods

Method Description
preset(string $name) Apply preset from config
generateWebp(bool $generate = true) Generate WebP version of the image
generateAvif(bool $generate = true) Generate AVIF version of the image
quality(int $quality) Set quality for original image (1-100, default: 85)
qualityWebp(int $quality) Set quality for WebP (1-100, default: 80)
qualityAvif(int $quality) Set quality for AVIF (1-100, default: 65)
pngIndexed(bool $indexed = true, int $colors) Optimize PNG with indexed colors (default: 256)
stripMetadata(bool $strip = true) Strip EXIF/IPTC metadata from images
maxDimensions(?int $width, ?int $height = null) Resize images while keeping aspect ratio
watermarkImage(...) Add image watermark
watermarkText(...) Add text watermark
watermarkTextFont(?string $fontPath) Set font for text watermark
watermarkTextStroke(?string $color, int $width) Add stroke to text watermark
watermarkTextAngle(?int $angle) Rotate text watermark
disableWatermark(bool $disable = true) Disable watermark for this field
queue(bool $enabled, ?string $connection, ?string $queue, $delay) Enable queue processing
queueDelay(...) Set queue delay
logging(bool $enabled = true) Enable logging (disabled by default)

PNG Optimization

PNG is a lossless format, so the quality parameter doesn't reduce file size. To optimize PNG files, use the pngIndexed() method which converts the image to use a palette of indexed colors (like GIF):

This can significantly reduce PNG file size, especially for images with limited colors.

AVIF Support

AVIF provides superior compression compared to WebP and JPEG. Use qualityAvif() to control the quality:

Recommended AVIF quality values:

Logs will appear in storage/logs/laravel.log with [InterventionImage] prefix:


Complete Examples

1. Simple Usage (without layouts-field)

For single and multiple images without the moonshine/layouts-field package.

Layout

Add the removeImage JavaScript function to your MoonShine layout:

Model

Resource

FormPage


2. Usage with layouts-field

When using moonshine/layouts-field package for flexible content blocks.

Layout

Add the removeImage and removeLayoutImage JavaScript functions to your MoonShine layout:

Model

Migration

Resource

FormPage


Supported Formats


All versions of moonshine-intervention-image with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
intervention/image Version ^3.0
intervention/image-laravel Version ^1.0
moonshine/moonshine Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package povly/moonshine-intervention-image contains the following files

Loading the files please wait ...