Download the PHP package matusstafura/faker-commerce without Composer
On this page you can find all versions of the php package matusstafura/faker-commerce. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download matusstafura/faker-commerce
More information about matusstafura/faker-commerce
Files in matusstafura/faker-commerce
Package faker-commerce
Short Description A PHP lib to generate dummy data for ecommerce
License MIT
Informations about the package faker-commerce
PHP Faker eCommerce
Generates meaningful dummy data for ecommerce use — product names, categories, prices, reviews and more — where the popular fzaninotto/faker-style generators only give you generic words or lorem-ipsum text.
Requirements
PHP 8.3, 8.4, or 8.5.
Install the package
Usage
Available generators
| Method | Returns |
|---|---|
availability() |
Stock status, e.g. "in stock" |
breadcrumbs(int $subcategories, string $separator) |
A category breadcrumb trail |
category() |
A single product category |
color() |
A CSS-style color name |
condition() |
A listing condition, e.g. "Like New" |
name(int $attributes = 1) |
A composed product name (attributes + type) |
attribute() |
A single material/style descriptor |
type() |
A single product type noun |
payment() |
A payment method |
price(int $min, int $max, int $decimals) |
A formatted price |
review() |
A product review sentence |
getAllMethods() |
Every available method, grouped by dataset |
Extending with your own datasets
Register a custom dataset class and its public methods become available on $faker too,
as long as none of its method names collide with an existing one:
addDataset() throws if the class doesn't exist, is already registered, or defines a
method name that already exists in another registered dataset.
Tests
Run the tests with Pest PHP
License
The MIT License (MIT). Please see License File for more information.
Contribution
Contributions are welcome and will be fully credited. Please, add tests if required.
Support
You can leave a star, or support ongoing development via GitHub Sponsors or Buy Me a Coffee.
Security
If you discover any security-related issues, please email us instead of using the issue tracker.
TODO
Please see TODO.md file.