Search by

toneflix / faker-pictwo

3m1n3nc3

An alternative image provider for fakerphp using Lorem Toneflix.

Package info

github.com/toneflix/php-faker-pictwo

Homepage

pkg:composer/toneflix/faker-pictwo

Fund package maintenance!

toneflix

Statistics

Installs: 107

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

2.1.1 2026-10-24 08:59 UTC

This package is auto-updated.

Last update: 2026-10-24 09:00:11 UTC


README

Latest Version on Packagist Tests Total Downloads

Introduction

Alternative image provider for fakerphp using pictwo.toneflix.net

Installation

You can install the package via composer in dev dependency section:

composer require --dev toneflix/faker-pictwo

Usage

$faker = \Faker\Factory::create();
$faker->addProvider(new \Toneflix\FakerPicTwo\FakerPicTwoProvider($faker));

// return a string that contains a url like 'https://pictwo.toneflix.net/images/avatar?w=800&h=600'
$faker->imageUrl(width: 800, height: 600, category: 'avatar');

// download a properly sized image from pictwo.toneflix.net into a file with a file path like '/tmp/13b73edae8443990be1aa8f1a483bc27.jpg'
$filePath= $faker->image(dir: '/tmp', width: 640, height: 480);

Also, there are some more options :

  • effects (grey for greyscale, pixelate for a pixelation level)
  • an optional text overlay
  • a category to restrict the image to (avatar, fashion, african-fashion, fabric, product, profile, design, nature, people, poster, event, album, cars, robots, technology)
  • randomize: false to drop the cache-busting random query parameter, so the same call returns a stable URL

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.