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

On this page you can find all versions of the php package povly/moonshine-image-editor. 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-image-editor

MoonShine Image Editor

Image editor for MoonShine admin panel powered by Filerobot Image Editor. Integrates with MoonShine Media Manager to provide in-browser image editing with automatic optimization and WebP/AVIF conversion.

Features

Requirements

Installation

Image Optimization Dependency

For image optimization and format conversion (WebP/AVIF) to work, install Intervention Image:

Note: Only intervention/image-laravel is needed — it automatically installs intervention/image as a dependency.

Publish the Intervention Image config (optional):

This creates config/image.php where you can set the default driver (GD or Imagick).

Publish assets:

Optionally publish config and translations:

Or everything at once:

Run migrations (creates image_editor_settings table):

Setup

1. Register assets

Add the package JS and CSS to your MoonShine layout's assets() method:

Note: The built-in Image Editor Settings page automatically registers these assets when loaded, so you only need this step if you want the editor modal available on other pages (e.g., Media Manager).

2. Render the editor modal

Add the modal to your layout's getContentComponents() method:

Alternatively, the legacy static helper still works:

The "Edit Image" button automatically appears in the Media Manager for image files. The listeners for upload optimization and delete cleanup are registered automatically — no additional setup required.

3. Image driver (recommended)

For best PNG optimization, install the Imagick PHP extension:

The package auto-detects the driver — if Imagick is available it will be used, otherwise GD. You can also configure it explicitly in config/image.php:

Note: GD cannot optimize PNG effectively — it often makes files larger. Imagick is strongly recommended for PNG support.

Configuration

Settings can be managed from the MoonShine admin panel (recommended) or via the config file. Database settings override config values at runtime.

Publish the config file (optional):

Config Options

Option Default Description
available_formats ['png', 'jpg'] Formats shown in the save dialog
quality.jpg 82 JPG quality (1–100). PNG is lossless, no quality setting.
optimize.enabled true Enable post-save optimization
optimize.strip_metadata true Strip EXIF/IPTC metadata
optimize.max_width null Max width (keeps aspect ratio)
optimize.max_height null Max height (keeps aspect ratio)
convert.webp.enabled false Generate WebP version
convert.webp.quality 80 WebP quality (1–100)
convert.avif.enabled false Generate AVIF version
convert.avif.quality 65 AVIF quality (1–100)
queue.enabled false Offload optimization to queue
queue.delay 60 Delay in seconds before processing
default_tabs ['Adjust', ...] Visible editor tabs
overwrite_original false Overwrite original or save with -edited suffix
locale null Editor language (null = auto-detect)

Localization

Translations are loaded from the package automatically. Supported languages:

To override translations, publish them:

Files will be published to lang/vendor/image-editor/en/ and lang/vendor/image-editor/ru/.

How It Works

Image Editor

  1. User clicks the "Edit Image" button in Media Manager
  2. A modal opens with the format selector toolbar and Filerobot Image Editor
  3. The format selector defaults to the original image format
  4. User edits the image (crop, filters, text, etc.)
  5. On save, the selected format is used — image is uploaded to the same directory as the original
  6. If overwrite_original is false (default), the file is saved with a -edited suffix
  7. Post-save: optimization runs, WebP/AVIF generated if enabled
  8. Size comparison: if optimized/conversion is larger → smaller version is kept

Automatic Upload Optimization

When a user uploads an image through the Media Manager:

  1. MediaManagerFileUploaded event fires
  2. OptimizeUploadedImage listener detects image files (jpg, png, gif, webp, avif)
  3. Image is optimized (strip metadata, resize if configured)
  4. WebP/AVIF versions generated if enabled
  5. Supports queue for async processing

Automatic Delete Cleanup

When a user deletes an image through the Media Manager:

  1. MediaManagerFileDeleted event fires
  2. DeleteImageConversions listener finds associated .webp and .avif files
  3. Conversion files are removed automatically

Size Comparison Logic

Admin Settings Page

The package adds a "Image Editor Settings" page to the MoonShine sidebar with two tabs:

Settings Tab

Configure optimization and conversion parameters stored in the database:

Settings are applied to the config at runtime on each request, so changes take effect immediately without editing config files.

Batch Optimization Tab

Re-process existing images with current settings:

  1. Choose filter: All images (recreate conversions) or Only without conversions (skip files that already have webp/avif)
  2. Scan files — shows count of matching originals (jpg/png/gif)
  3. Start processing — runs via Laravel Bus::batch on the images queue
  4. Real-time progress bar with processed/total counter
  5. Detailed log showing per-file results:
    • Original: photo.jpg (100 KB → 95 KB, -5%)
    • WebP conversion: → photo.webp (95 KB → 50 KB, -47.4%, vs original)
    • AVIF conversion: → photo.avif (50 KB → 30 KB, -40%, vs webp)
    • Automatic deletion: → photo.webp deleted (larger than original)

Queue Worker Setup

For batch processing (and async optimization), run a queue worker:

For production, use Supervisor to keep the worker running:

Format Conversion Flow

Filerobot always exports PNG regardless of the user's format choice. The server handles format conversion:

Artisan Commands

Command Description
image-editor:optimize {path} --disk=public --queue Optimize a single image and generate conversions. Use --queue to dispatch async.
image-editor:clear-conversions --disk=public --path= --dry-run Remove orphan WebP/AVIF files where the original image no longer exists. Use --dry-run to preview.
image-editor:reset-settings Reset image editor settings stored in DB back to config defaults.

Security

All controller endpoints are protected by MoonShine auth middleware. Additionally:

Publishing

Tag Description
image-editor-assets JS and CSS files to public/vendor/image-editor/
image-editor-config Config to config/moonshine/image_editor.php
image-editor-lang Translations to lang/vendor/image-editor/
image-editor-migrations Migrations to database/migrations/

Note: Migrations run automatically from the package via loadMigrationsFrom() when you run php artisan migrate. If you need to customize them or prefer having them in your project's database/migrations/ directory, publish them explicitly:

License

MIT


Related

This package uses Intervention Image for server-side image processing (optimization, format conversion, WebP/AVIF generation).


All versions of moonshine-image-editor 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
yurizoom/moonshine-media-manager 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-image-editor contains the following files

Loading the files please wait ...