1. Go to this page and download the library: Download matusstafura/faker-commerce 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/ */
matusstafura / faker-commerce example snippets
use FakerCommerce\Faker\FakerFactory;
// Use a factory to initialize
$faker = FakerFactory::create();
$faker->availability();
// "out of stock"
$faker->breadcrumbs(4, ">");
// "Radio>Instruments>Materials & Supplies>Accessories"
$faker->category();
// "Action Figures"
$faker->color();
// "Coral"
$faker->condition();
// "Very Good"
$faker->name();
// "Quilted Leather Jacket"
$faker->name(2);
// "Cropped Denim Jacket"
$faker->name(0);
// "Jacket" (just the product type, no descriptors)
$faker->attribute();
// "Chunky"
$faker->type();
// "Cardigan"
$faker->payment();
// "cash on delivery"
$faker->price();
// "557.00"
$faker->review();
// "Expensive for the quality."
$faker->getAllMethods();
// lists all available methods, grouped by dataset class
use FakerCommerce\Faker\Dataset;
use FakerCommerce\Faker\Faker;
$dataset = new Dataset();
$dataset->addDataset(MyApp\Faker\Sku::class);
$faker = new Faker($dataset->getDatasets());
$faker->sku();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.