PHP code example of matusstafura / faker-commerce

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();
// leather shorts

$faker->payment();
// "cash on delivery"

$faker->price();
// "557.00"

$faker->review();
// "Expensive for the quality."

$f->getAllMethods();
// lists all available methods