Alternative image provider for fakerphp using lorem.toneflix.com.ng
You can install the package via composer in dev dependency section:
composer require --dev toneflix-code/fakerphp-lorem-toneflix
$faker = \Faker\Factory::create();
$faker->addProvider(new \ToneflixCode\FakerLoremToneflix\FakerLoremToneflixProvider($faker));
// return a string that contains a url like 'https://lorem.toneflix.com.ng/images/avatar?w=800&h=600'
$faker->imageUrl(width: 800, height: 600, category: 'avatar');
// download a properly sized image from lorem toneflix 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 (grayscale, pixelate)
- returning a specific photo based on an id instead of a random one (ex: https://lorem.toneflix.com.ng/images/image/00020)
composer test
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.