PHPackages                             vgirol/jsonapi-faker-laravel - 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. [API Development](/categories/api)
4. /
5. vgirol/jsonapi-faker-laravel

AbandonedArchivedLibrary[API Development](/categories/api)

vgirol/jsonapi-faker-laravel
============================

This package provides a factory to generate fake data using Laravel and the JSON:API specification.

v1.2.0(5y ago)02591MITPHPPHP ^7.3|^8.0

Since Sep 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/VGirol/JsonApi-Faker-Laravel)[ Packagist](https://packagist.org/packages/vgirol/jsonapi-faker-laravel)[ Docs](http://github.com/VGirol/JsonApi-Faker-Laravel)[ RSS](/packages/vgirol-jsonapi-faker-laravel/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (7)Versions (11)Used By (1)

JsonApi-Faker-Laravel
=====================

[](#jsonapi-faker-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7d652030055332f3543658cb56a20398549bcc35f2fc6e17d53021811ac91e45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f564769726f6c2f4a736f6e4170692d46616b65722d4c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/VGirol/JsonApi-Faker-Laravel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/5512bb8ac65cb4261ea53b9dfcb83cb5df6999f668adf4ded030d3ab820179a6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f564769726f6c2f4a736f6e4170692d46616b65722d4c61726176656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/VGirol/JsonApi-Faker-Laravel)[![Coverage Status](https://camo.githubusercontent.com/1c5137c2e5e3e0379307ab3cb23795c8a6d762c406c3ef486706565a60ec69f3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f564769726f6c2f4a736f6e4170692d46616b65722d4c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/VGirol/JsonApi-Faker-Laravel/code-structure)[![Quality Score](https://camo.githubusercontent.com/47d34ebeb230faf8fa6c5008aae43900f8d20cd8298e727b665020ba90ebd1a0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f564769726f6c2f4a736f6e4170692d46616b65722d4c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/VGirol/JsonApi-Faker-Laravel)[![Infection MSI](https://camo.githubusercontent.com/1c7a9d86bd20d145080f98e68cd0d58fe41b41213899e40039b57298fc9ffd38/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246564769726f6c2532464a736f6e4170692d46616b65722d4c61726176656c2532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/VGirol/JsonApi-Faker-Laravel/master)[![Total Downloads](https://camo.githubusercontent.com/064d3680f48cfa81ef08f97aa905b7da8f330dc9573faa7b3934abef0b8ad98a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f564769726f6c2f4a736f6e4170692d46616b65722d4c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/VGirol/JsonApi-Faker-Laravel)

This package provides a set of factories to build fake data using Laravel and the [JSON:API specification](https://jsonapi.org/).

Technologies
------------

[](#technologies)

- PHP 7.2+
- Laravel 5.8+

Installation
------------

[](#installation)

To install through composer, simply put the following in your `composer.json` file:

```
{
    "require-dev": {
        "vgirol/jsonapi-faker-laravel": "dev-master"
    }
}
```

And then run `composer install` from the terminal.

### Quick Installation

[](#quick-installation)

Above installation can also be simplified by using the following command:

```
composer require vgirol/jsonapi-faker-laravel
```

Usage
-----

[](#usage)

First create a faker generator.

```
use VGirol\JsonApiFaker\Laravel\Generator as JsonApiFaker;

$faker = new JsonApiFaker;
```

Then create a model and a factory.

```
$model = new DummyModel();
$factory = $faker->resourceObject($model, 'resourceType');
```

Next you can fill the factory ...

```
$factory->setMeta([
            'key1' => 'meta1'
        ])
        ->addLink('self', 'url');
```

Finally export as an array or as JSON.

```
$array = $factory->toArray();
$json = $factory->toJson();
```

All these instructions can be chained.

```
use VGirol\JsonApiFaker\Generator as JsonApiFaker;

$model = new DummyModel();
$json = new JsonApiFaker()
    ->resourceObject($model, 'resourceType')
    ->setMeta([
            'key1' => 'meta1'
        ])
    ->toJson();
```

Documentation
-------------

[](#documentation)

The API documentation is available in XHTML format at the url .

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Girol Vincent](https://github.com/VGirol)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~64 days

Recently: every ~34 days

Total

10

Last Release

1863d ago

PHP version history (4 changes)v1.0.0PHP ^7.2

v1.0.3PHP ^7.2.5|^7.3

v1.1.0PHP ^7.3

v1.2.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c5077b4f7fc77f8df031535dc5c832fa9ce6b6d2c90132e3093ea6648bfcde46?d=identicon)[VGirol](/maintainers/VGirol)

---

Top Contributors

[![VGirol](https://avatars.githubusercontent.com/u/18059718?v=4)](https://github.com/VGirol "VGirol (124 commits)")

---

Tags

laravelJSON-APIFake datavgirolJsonApi-Faker-Laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vgirol-jsonapi-faker-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/vgirol-jsonapi-faker-laravel/health.svg)](https://phpackages.com/packages/vgirol-jsonapi-faker-laravel)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[cloudcreativity/laravel-json-api

JSON API (jsonapi.org) support for Laravel applications.

7881.1M5](/packages/cloudcreativity-laravel-json-api)[laravel-json-api/laravel

JSON:API for Laravel applications.

6371.4M15](/packages/laravel-json-api-laravel)[timacdonald/json-api

A Lightweight JSON:API Resource for Laravel

639892.5k2](/packages/timacdonald-json-api)[swisnl/openapi-spec-generator

Creates Open API spec for a Laravel JSON:API

2338.1k](/packages/swisnl-openapi-spec-generator)

PHPackages © 2026

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