PHPackages                             yllw-digital/laravel-chatgpt-mock-api - 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. yllw-digital/laravel-chatgpt-mock-api

ActiveLibrary[API Development](/categories/api)

yllw-digital/laravel-chatgpt-mock-api
=====================================

Generate smart API mocks in Laravel using ChatGPT prompts

v0.1(2y ago)1391537[1 PRs](https://github.com/yllw-digital/laravel-chatgpt-mock-api/pulls)MITPHPPHP ^8.1

Since Jun 21Pushed 2y ago2 watchersCompare

[ Source](https://github.com/yllw-digital/laravel-chatgpt-mock-api)[ Packagist](https://packagist.org/packages/yllw-digital/laravel-chatgpt-mock-api)[ Docs](https://github.com/yllw-digital/laravel-chatgpt-mock-api)[ RSS](/packages/yllw-digital-laravel-chatgpt-mock-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

Laravel ChatGPT Mock API Generator
==================================

[](#laravel-chatgpt-mock-api-generator)

Generate smart API mocks in Laravel using ChatGPT prompts.

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

[](#installation)

```
composer require --dev yllw-digital/laravel-chatgpt-mock-api
```

You'll need to then publish the config file and migrations:

```
php artisan vendor:publish --provider="YellowDigital\LaravelChatgptMockApi\LaravelChatgptMockApiServiceProvider"
```

Run migrate to create the cache table:

```
php artisan migrate
```

Finally you'll need to add your OpenAI API key to your `.env` file:

```
OPENAI_API_KEY=sk-...

```

Usage
-----

[](#usage)

In your `routes/api.php` file, add the following:

```
use YellowDigital\LaravelChatgptMockApi\Facades\ChatGPTMockApi;

Route::get("/mock-response", function() {
    return ChatGPTMockApi::generate(
        prompt: "European countries and their national food",
        keys: [
            "id",
            "name",
            "food",
            "food_description",
        ],
        count: 3,
    );
});
```

This will generate a response like the following:

```
[
    {
        "id": 1,
        "name": "Italy",
        "food": "Pizza",
        "food_description": "A delicious round dough topped with tomato sauce, cheese and a variety of toppings."
    },
    {
        "id": 2,
        "name": "France",
        "food": "Croissants",
        "food_description": "A flaky, buttery pastry that is commonly eaten for breakfast or as a snack."
    },
    {
        "id": 3,
        "name": "Spain",
        "food": "Paella",
        "food_description": "A rice dish that originated in Valencia and is typically made with saffron, chicken, and shellfish."
    }
]
```

Caching
-------

[](#caching)

By default, the package will cache the generated responses in your DB so that you don't hit the OpenAI API limit. You can disable this by setting like so:

```
ChatGPTMockApi::generate(
    prompt: "European countries and their national food",
    keys: [
        "id",
        "name",
        "food",
        "food_description",
    ],
    count: 3,
    cache: false,
);
```

Changing ChatGPT model
----------------------

[](#changing-chatgpt-model)

By default, the package will use the `gpt-3.5-turbo` model. You can change this by setting like so:

```
ChatGPTMockApi::generate(
    prompt: "European countries and their national food",
    keys: [
        "id",
        "name",
        "food",
        "food_description",
    ],
    count: 3,
    model: "gpt-3.5-turbo-0301",
);
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Credits
-------

[](#credits)

- [Yellow Digital](https://yllwdigital.com)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

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

1056d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d248357fed636e83b6843a736c09e78cf0505890c37587f013a76c9787b30fb?d=identicon)[andyabih](/maintainers/andyabih)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelyllw-digitallaravel-chatgpt-mock-api

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/yllw-digital-laravel-chatgpt-mock-api/health.svg)

```
[![Health](https://phpackages.com/badges/yllw-digital-laravel-chatgpt-mock-api/health.svg)](https://phpackages.com/packages/yllw-digital-laravel-chatgpt-mock-api)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.0k7.8M57](/packages/dedoc-scramble)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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