All Projects → bluemmb → Faker-PicsumPhotos

bluemmb / Faker-PicsumPhotos

Licence: MIT license
picsum.photos Provider for PHP Faker

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Faker-PicsumPhotos

hes-gallery
Light, dependency free, responsive gallery script
Stars: ✭ 27 (+8%)
Mutual labels:  photos
Faker.NET.Portable
C# port of the Ruby Faker gem (http://faker.rubyforge.org/)
Stars: ✭ 22 (-12%)
Mutual labels:  faker
InstaSmart
A Flutter app to plan and beautify your Instagram feed
Stars: ✭ 18 (-28%)
Mutual labels:  photos
TFaker
🔮 TFaker is a data generator inspired by https://github.com/fzaninotto/Faker and many others.
Stars: ✭ 23 (-8%)
Mutual labels:  faker
fake-web-events
Creates a Simulation of Fake Web Events
Stars: ✭ 48 (+92%)
Mutual labels:  faker
Data-Mocking
A tool that USES a template engine to generate data
Stars: ✭ 16 (-36%)
Mutual labels:  faker
Mockaco
🐵 HTTP mock server, useful to stub services and simulate dynamic API responses, leveraging ASP.NET Core features, built-in fake data generation and pure C# scripting
Stars: ✭ 213 (+752%)
Mutual labels:  faker
KissNetwork.bundle
Plex Channel to view Anime, Asian Drama, Cartoons, Manga & Comics from KissAnime, KissAsian, KissCartoon, KissManga & ReadComicOnline
Stars: ✭ 95 (+280%)
Mutual labels:  photos
node-500px
A wrapper for the 500px.com API
Stars: ✭ 41 (+64%)
Mutual labels:  photos
blaver
A JavaScript library built on top of the Faker.JS library. It generates massive amounts of fake data in the browser and node.js.
Stars: ✭ 112 (+348%)
Mutual labels:  faker
fastfaker
Fast, concurrent fake data generator for any structure or type.
Stars: ✭ 21 (-16%)
Mutual labels:  faker
flickrsavr
A preservation experiment to save photos from Flickr to your disk with the metadata embedded.
Stars: ✭ 17 (-32%)
Mutual labels:  photos
fb-photos
Download "Photos of me" on Facebook
Stars: ✭ 31 (+24%)
Mutual labels:  photos
faker
A set of javascript packages that generates fake data for you.
Stars: ✭ 33 (+32%)
Mutual labels:  faker
Capturable
🚀Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image🖼️
Stars: ✭ 365 (+1360%)
Mutual labels:  photos
tg-file-decoder
Decode Telegram bot API file IDs
Stars: ✭ 30 (+20%)
Mutual labels:  photos
LPThumbnailView
A thumbnail view for iOS to give context to multiple images/videos using thumbnails and counter.
Stars: ✭ 54 (+116%)
Mutual labels:  photos
ZLPhotoBrowser-objc
(ZLPhotoBrowser oc 版本)轻量级照片选择框架,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑裁剪图片/视频,支持多语言国际化等功能
Stars: ✭ 54 (+116%)
Mutual labels:  photos
faker-buzzword-job-titles
👔 A job title generator for faker based on Buzzwords.
Stars: ✭ 14 (-44%)
Mutual labels:  faker
photos2geojson
html map gallery from photos
Stars: ✭ 39 (+56%)
Mutual labels:  photos

Picsum.photos Provider for PHP Faker

Build Status

Build gives error for php 7.1 and 7.2 versions only because of phpunit version

picsum.photos provider for Faker.

Versions

Version 2

Notice: This is documentation for new version, for older version go to Version v1

Install

Install the PicsumPhotos Provider by adding bluemmb/faker-picsum-photos-provider: "^2.0" to your composer.json or from CLI:

$ composer require bluemmb/faker-picsum-photos-provider ^2.0

Usage

$faker = Faker\Factory::create();
$faker->addProvider(new Bluemmb\Faker\PicsumPhotosProvider($faker));

// simple usage
$url = $faker->imageUrl();              // https://picsum.photos/640/480
$url = $faker->imageUrl(500);           // https://picsum.photos/500/480
$url = $faker->imageUrl(500,500);       // https://picsum.photos/500/500

/*
 * $specificOrSeed
 *      - false | null : create simple url with no id or seed
 *      - true         : create id/{random id} url
 *      - int          : create id/{int} url
 *      - string       : create seed/{seed} url
 */
$url = $faker->imageUrl(500,500, false);    // https://picsum.photos/500/500
$url = $faker->imageUrl(500,500, true);     // https://picsum.photos/id/70/500/500
$url = $faker->imageUrl(500,500, true);     // https://picsum.photos/id/413/500/500
$url = $faker->imageUrl(500,500, 33);       // https://picsum.photos/id/33/500/500
$url = $faker->imageUrl(500,500, '33');     // https://picsum.photos/seed/33/500/500
$url = $faker->imageUrl(500,500, 'wow');    // https://picsum.photos/seed/wow/500/500

// Some image id's are invalid, So the package automatically replaces them
$url = $faker->imageUrl(500,500, 86);       // https://picsum.photos/id/82/500/500


/*
 *  More options :
 *  function imageUrl(
 *      $width = 640, $height = 480, $specificOrSeed=null, 
 *      $grayscale=null, $blur=null, $file_ending=null
 * )
 */
 
// https://picsum.photos/100/100?grayscale=true
$url = $faker->imageUrl(
    100,100, false, 
    true
);

// https://picsum.photos/g/100/100?blur=true
$url = $faker->imageUrl(
    100,100, false, 
    false, true
);

// https://picsum.photos/100/100?blur=5
$url = $faker->imageUrl(
    100,100, false, 
    false, 5
);

// https://picsum.photos/300/100.jpg
$url = $faker->imageUrl(
    300,100, false, 
    false, false, 'jpg'
);

// https://picsum.photos/id/88/300/100.webp?grayscale=true&blur=3
$url = $faker->imageUrl(
    300,100, 88,
    true, 3, 'webp'
);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].