Download the PHP package laratusk/pictomock without Composer

On this page you can find all versions of the php package laratusk/pictomock. 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 pictomock

PictoMock

Latest Version on Packagist PHP Version Tests

PictoMock is a lightweight, framework-agnostic PHP library for generating fake placeholder images — perfect for testing, seeding databases, and prototyping. It supports SVG (zero dependencies), PNG, JPEG, GIF, WebP, and WBMP via the GD extension, with a clean fluent API and first-class Laravel and FakerPHP integration.


Features


Installation

For raster image formats (PNG, JPEG, GIF, WebP, WBMP) the PHP GD extension is required:


Quick Start


Usage

Static API

Signature:

Fluent API

The builder is immutable — each method returns a new instance, making it safe to fork:

Background Strategies

Random Color (default)

Fixed Color

Gradient Color

The gradient is rendered left-to-right for GD images and as an SVG linearGradient for SVG output.

Text Overlay

Add the image dimensions as a centered text label:

SVG Generation (no GD required)

The SVG generator uses PHP's built-in DOMDocument and requires only ext-dom.


Laravel Integration

Auto-Discovery

The service provider and facade are auto-discovered via composer.json extra.laravel. No manual registration needed for Laravel 5.5+.

Publish Config

This publishes config/pictomock.php to your application.

Facade

Config Reference

Database Factories with FakerPHP

Register the provider in your AppServiceProvider or a dedicated faker service provider:

Then use it in factories:


FakerPHP Integration (Standalone)

Available Faker Methods

Method Description
pictoMock(int $w, int $h, string $format, bool $text) Generate image and return file path
pictoMockUrl(int $w, int $h, string $format) Generate image and return data URI

ImageFormat Enum

All supported formats are defined in Laratusk\PictoMock\Enums\ImageFormat:

Case Value MIME Type Requires GD
ImageFormat::SVG svg image/svg+xml No
ImageFormat::PNG png image/png Yes
ImageFormat::JPG jpg image/jpeg Yes
ImageFormat::JPEG jpeg image/jpeg Yes
ImageFormat::GIF gif image/gif Yes
ImageFormat::WEBP webp image/webp Yes
ImageFormat::WBMP wbmp image/vnd.wap.wbmp Yes

Testing

Run only unit tests:

Run only integration tests:


Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Write tests for your changes
  4. Ensure all tests pass (./vendor/bin/phpunit)
  5. Follow PSR-12 coding standards
  6. Submit a pull request

Please open an issue before implementing large changes.


License

The MIT License (MIT). See LICENSE for details.


All versions of pictomock with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-dom Version *
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 laratusk/pictomock contains the following files

Loading the files please wait ...