PHP code example of mbezhanov / faker-provider-collection

1. Go to this page and download the library: Download mbezhanov/faker-provider-collection library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mbezhanov / faker-provider-collection example snippets




$faker = \Faker\Factory::create();
\Bezhanov\Faker\ProviderCollectionHelper::addAllProvidersTo($faker);



$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Avatar($faker));

$faker->avatar; // https://robohash.org/repellat-veritatis-consequatur.png?size=300x300&set=set1
$faker->avatar('foo'); // https://robohash.org/foo.png?size=300x300&set=set1
$faker->avatar('foo', '300x300'); // https://robohash.org/foo.png?size=300x300&set=set1
$faker->avatar('foo', '300x300', 'jpg'); // https://robohash.org/foo.jpg?size=300x300&set=set1
$faker->avatar('foo', '300x300', 'jpg', 'set2'); // https://robohash.org/foo.jpg?size=300x300&set=set2
$faker->avatar('foo', '300x300', 'jpg', 'set2', 'bg2'); // https://robohash.org/foo.jpg?size=300x300&set=set2&bgset=bg2




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Commerce($faker));

$faker->promotionCode; // KillerPromotion257835
$faker->department; // Kids & Games
$faker->department(6); // Games, Industrial, Books & Automotive
$faker->department(3, true); // Jewelry, Music & Shoes
$faker->category; // Computers
$faker->productName; // Small Rubber Bottle




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Device($faker));

$faker->deviceBuildNumber; // 186
$faker->deviceManufacturer; // Apple
$faker->deviceModelName; // iPhone 4
$faker->devicePlatform; // Ubuntu Touch
$faker->deviceSerialNumber; // ejfjnRNInxh0363JC2WM
$faker->deviceVersion; // 812




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Demographic($faker));

$faker->race; // Asian
$faker->educationalAttainment; // Master's degree
$faker->demonym; // Bulgarian
$faker->maritalStatus; // Married
$faker->gender; // Female
$faker->height; // 1.99
$faker->height(Demographic::UNIT_TYPE_IMPERIAL); // 7 ft, 2 in




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Educator($faker));

$faker->university; // Clearcourt University
$faker->secondarySchool; // Mallowpond High
$faker->course; // Bachelor of Forensic Science
$faker->campus; // Brighthurst Campus




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Food($faker));

$faker->ingredient; // Hazelnut
$faker->spice; // Chamomile
$faker->measurement; // 1 pint




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Medicine($faker));

$faker->medicine; // Amphevorin




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Placeholder($faker));

$faker->placeholder(); // https://placehold.it/300x300.png
$faker->placeholder('250x250'); // https://placehold.it/250x250.png
$faker->placeholder('250x250', 'jpg'); // https://placehold.it/250x250.jpg
$faker->placeholder('250x250', 'jpg', 'ff0000'); // https://placehold.it/250x250.jpg/ff0000
$faker->placeholder('250x250', 'jpg', 'f00', '000000'); // https://placehold.it/250x250.jpg/f00/000000
$faker->placeholder('250x250', 'jpg', 'ff0000', '000', 'test'); // https://placehold.it/250x250.jpg/ff0000/000?text=test




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Science($faker));

$faker->chemicalElement; // Radium
$faker->chemicalElementSymbol; // Fe
$faker->scientist; // Max Planck




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Space($faker));

$faker->planet; // Neptune
$faker->moon; // Europa
$faker->galaxy; // Andromeda
$faker->nebula; // Orion Nebula
$faker->starCluster; // Palomar 6
$faker->constellation; // Ursa Major
$faker->star; // Luyten 726-8B
$faker->agency; // Japan Aerospace Exploration Agency
$faker->agencyAbv; // NASA
$faker->nasaSpaceCraft; // Atlantis
$faker->spaceCompany; // SpaceX
$faker->distanceMeasurement; // 43 kiloparsecs
$faker->meteorite; // Qidong
$faker->launchVehicle; // Saturn IV




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Species($faker));

echo $faker->bird . PHP_EOL; // Rostratula subis
echo $faker->creature . PHP_EOL; // Latrodectus indri
echo $faker->plant . PHP_EOL; // Pyrus filiformis




$faker = \Faker\Factory::create();
$faker->addProvider(new \Bezhanov\Faker\Provider\Team($faker));

$faker->team; // Oregon Tigers
$faker->sport; // soccer