Faker provider for generating random images in your PHP projects. The default faker image provider, Lorem Pixel, is fine but it has too many requests and slow down your testing environment. This is the main reason why i made this PHP package.
Via Composer
$ composer require randimg/faker-randimg-provider
use Faker\Factory;
use Faker\Generator;
use Siro\RandImg\RandImgProvider;
$faker = Factory::create();
$faker->addProvider(new RandImgProvider($faker));
$faker->imageUrl(); // http://www.rand-img.com/720/480
$faker->imageUrl(300, 200); // http://www.rand-img.com/300/200
$faker->imageUrl(720, 480, 'sky'); // http://www.rand-img.com/720/480/sky
$faker->imageUrl(720, 480, 'food', ['rand' => true]); // http://www.rand-img.com/720/480/food?rand=4234532
$faker->imageUrl(720, 480, 'food', ['rand' => true, 'blur' => 4, 'gray' => 1]); // http://www.rand-img.com/720/480/food?rand=4234532&blur=4&gray=1
$faker->image(__DIR__, 200, 200); // image path and filename joined
$faker->image(__DIR__, 200, 200); // image path and filename joined
$faker->gif(); // gif path and filename
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email siro_diaz@yahoo.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.