PHPackages                             sparkapi/feed-faker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sparkapi/feed-faker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sparkapi/feed-faker
===================

A fake datasource using RESO standard fields

v0.8(9y ago)62.3k4PHPPHP ^5.6 || ^7.0

Since Apr 27Pushed 7y ago10 watchersCompare

[ Source](https://github.com/sparkapi/feed-faker)[ Packagist](https://packagist.org/packages/sparkapi/feed-faker)[ RSS](/packages/sparkapi-feed-faker/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (7)Versions (3)Used By (0)

RESO Feed Faker
---------------

[](#reso-feed-faker)

[![Latest Version](https://camo.githubusercontent.com/809ea21d694b664667737b9de93a9ece1dd3c0755eb8e34c8dae751e6ef76df2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f737061726b6170692f666565642d66616b65722e7376673f7374796c653d666c61742d737175617265)](https://github.com/sparkapi/feed-faker/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/55b63e877d79361189b540882aaea69f925c0af6a94bafb4251452ae68c81cef/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f737061726b6170692f666565642d66616b65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/sparkapi/feed-faker)[![Total Downloads](https://camo.githubusercontent.com/e04d4f1216031655f9b914a6f2e5e84b7236a6bd736c88ba533a1a35997602ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737061726b6170692f666565642d66616b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sparkapi/feed-faker)

FeedFaker allows you to generate a ton of fake RESO-compliant feed data objects quickly and easily, in a way that will keep the IDs at least semi-referentially linked for imports into databases.

Docker Quick Start
------------------

[](#docker-quick-start)

```
$ docker run -d -p 8080:80 sparkapi/faker-wrapper

$ curl http://localhost:8080/property
[{"ListingKey":"20170428170051261516000000","ListingId":"201704281...

# Hooray!

```

### List of Faker Endpoints in the Docker Image

[](#list-of-faker-endpoints-in-the-docker-image)

- Properties: [http://localhost:8080/property/{optional\_count}](http://localhost:8080/property/%7Boptional_count%7D)
- Members: [http://localhost:8080/member/{optional\_count}](http://localhost:8080/member/%7Boptional_count%7D)
- Offices: [http://localhost:8080/office/{optional\_count}](http://localhost:8080/office/%7Boptional_count%7D)
- Open House: [http://localhost:8080/openhouse/{optional\_count}](http://localhost:8080/openhouse/%7Boptional_count%7D)
- History: [http://localhost:8080/history/{optional\_count}](http://localhost:8080/history/%7Boptional_count%7D)
- Media: [http://localhost:8080/media/jpeg/{optional\_count}](http://localhost:8080/media/jpeg/%7Boptional_count%7D)

Install via Composer
--------------------

[](#install-via-composer)

`$ composer require sparkapi/feed-faker`

(or)

```
{
    "require": {
        "sparkapi/feed-faker": "^0.8"
    }
}
```

Example Usage
-------------

[](#example-usage)

First define your settings for keys and the number and type of objects to create.

If you are using the unsplash photo provider you will have to pass in a few additional settings. If you want to use a different image provider, pass in the class to that provider.

All other settings have defaults, so feel free to modify what you want and leave blank the rest.

```
$settings = [
    // required for photo providers
    'unsplash_app_id' => 'your_unsplash_app_id', // unsplash specific
    'interior_collection' => collection_id, // unsplash collection or filesystem path if using local photo provider
    'exterior_collection' => collection_id, // unsplash collection or filesystem path if using local photo provider
    'portrait_collection' => collection_id, // unsplash collection or filesystem path if using local photo provider

    // Optional photo provider, if not using unsplash (you can ignore the above, too).
    'photo_provider' => \FeedFaker\Helper\UnsplashPhotoProvider::class,

    // Basic settings, all with defaults.
    'mls_id' => 'my-awesome-mls',

    // the number of objects you want to create for each resource type.
    'office_count' => 50,
    'member_count' => 150,
    'property_count' => 500,
    'openhouse_count' => 1000,
    'history_count' => 1000,
    'media_count' => 5000,
];
```

You may provide a valid full path to a php settings file that returns an array, if you prefer. An example is in `settings.php.dist`.

Now that you're all setup, instantiate it and fire away:

```
$settings = [
    'unsplash_app_id' => 'my-app-id-from-unsplash'
    'interior_collection' => 10
    'exterior_collection' => 1010
    'portrait_collection' => 101010

    // optional
    'mls_id' => 'best-mls-in-the-universe',
    'history_count' => 500
];

$feedfake = new FeedFaker\FakeFeed();
$data = $feedfake->go($settings);

$properties = $data['property'];
$offices = $data['office'];
$members = $data['member'];
$media = $data['media'];
$history = $data['history'];
$openhouses = $data['openhouse'];

foreach ($properties as $property) {
    echo $property->getListingKey() . PHP_EOL;

    var_dump($property->toArray());
}
```

Yep, that's it. You're welcome.

Optional Logging
----------------

[](#optional-logging)

The Faker can also log information to any PSR-3 compatible logger. (Useful for Image provider errors, etc.)

You have two options to set one up: Give it **your own logger**, or provide a setup **callable** for MonoLog.

### Setup Callable for Monolog

[](#setup-callable-for-monolog)

By default, Faker uses Monolog to handle any logging, which uses handlers to know where and what details to log. If you provide no setup or logger, Faker will default to a `NullHandler` and save no log information.

You may provide any callable as the second parameter for `FakeFeed`. This callable accepts a monolog `Logger` instance and doesn't need to return anything.

```
$logger_setup = function($monolog) {
    // Save all debug and above messages to a file
    $monolog->pushHandler(new StreamHandler('/path/to/logs.log', \Monolog\Logger::DEBUG));

    // Save more important messages to some other place
    $monolog->pushHandler(new SomeOtherHandler(\Monolog\Logger::WARNING));
};

$feedfake = new FeedFaker\FakeFeed([], $logger_setup);
$data = $feedfake->go()
```

### Your own logger

[](#your-own-logger)

You may also skip monolog altogether and provide any instance of a PSR-3 compatible logger as the second argument.

```
$feedfake = new FeedFaker\FakeFeed([], $my_psr_3_logger);
$data = $feedfake->go()
```

Interoperability
----------------

[](#interoperability)

Feed Faker is [PSR compliant](http://www.php-fig.org/) and [Container Interoperability](https://github.com/container-interop/container-interop) compliant. Any oversights, please let us know.

Testing
-------

[](#testing)

We try for at least 80% test coverage.

```
$ phpunit
```

Note tht the `UnsplashPhotoProviderTest`s are skipped. These require a valid credential. You may extend and run these tests with your own credentials. A better (environment-based) system is on the way.

Contributing
------------

[](#contributing)

Contributions are welcome and will be fully credited. Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Open an issue to join in!

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3350d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/585323?v=4)[sparkapi](/maintainers/sparkapi)[@sparkapi](https://github.com/sparkapi)

---

Top Contributors

[![fbstim](https://avatars.githubusercontent.com/u/20247038?v=4)](https://github.com/fbstim "fbstim (50 commits)")[![calh](https://avatars.githubusercontent.com/u/1163502?v=4)](https://github.com/calh "calh (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sparkapi-feed-faker/health.svg)

```
[![Health](https://phpackages.com/badges/sparkapi-feed-faker/health.svg)](https://phpackages.com/packages/sparkapi-feed-faker)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k16.2k47](/packages/elgg-elgg)[rareloop/lumberjack-core

A powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code

40159.2k19](/packages/rareloop-lumberjack-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
