Search by

microweber-packages / microweber-media-pixum

boksiora

Standalone Laravel package for generating and serving placeholder (pixum) images. No exit() calls — fully testable.

Package info

github.com/microweber-packages/microweber-media-pixum

pkg:composer/microweber-packages/microweber-media-pixum

Statistics

Installs: 3

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-11-03 11:41 UTC

This package is auto-updated.

Last update: 2026-11-03 17:07:04 UTC


README

Standalone Laravel package for generating and serving placeholder (pixum) PNG images.

Features

  • No exit() calls — fully testable with PHPUnit, Dusk, and Livewire
  • Cached generation — images are generated once and served from disk
  • Configurable — background colour, max dimensions, cache path
  • Standalone — works in any Laravel 10+ application
  • Route & helpers — pixum($width, $height) helper and /pixum_img route

Installation

composer require microweber-packages/microweber-media-pixum

The package auto-discovers its service provider. Publish the config:

php artisan vendor:publish --tag=media-pixum-config

Usage

Helper function

// Returns URL to a 200×200 placeholder
$url = pixum(200, 200);

// Returns filesystem path
$path = pixum_path(300, 200);

Facade

use MicroweberPackages\MediaPixum\Facades\Pixum;

$path = Pixum::generate(400, 300);
$url  = Pixum::url(400, 300);

Route

GET /pixum_img?width=200&height=200

Returns a PNG image with appropriate caching headers.

Configuration

See config/media-pixum.php for all options.

Testing

composer test

License

MIT