PHPackages                             alnutile/laravel-chatgpt - 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. alnutile/laravel-chatgpt

ActiveLibrary[API Development](/categories/api)

alnutile/laravel-chatgpt
========================

Some base client work to talk to the api

0.0.5(3y ago)53.5k↓50%3[1 PRs](https://github.com/alnutile/laravel-ai-client/pulls)MITPHPPHP ^8.1

Since Feb 3Pushed 3y ago2 watchersCompare

[ Source](https://github.com/alnutile/laravel-ai-client)[ Packagist](https://packagist.org/packages/alnutile/laravel-chatgpt)[ Docs](https://github.com/alnutile/laravel-chatgpt)[ RSS](/packages/alnutile-laravel-chatgpt/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (16)Versions (6)Used By (0)

Base client to talk to ChatBot amd Dall-e2 and Soon Other Services
==================================================================

[](#base-client-to-talk-to-chatbot-amd-dall-e2-and-soon-other-services)

[![Latest Version on Packagist](https://camo.githubusercontent.com/57d88f008c7f0a7881adb83d2ae0a7b5f023f4b346fd6ee18fab8bae4b3b35bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6e7574696c652f6c61726176656c2d636861746770742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alnutile/laravel-chatgpt)[![GitHub Tests Action Status](https://camo.githubusercontent.com/bec50c2adf86dba056f382d6d51a19751bdfbb529d1e215ecc0fb06da85d4cb4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6e7574696c652f6c61726176656c2d636861746770742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/alnutile/laravel-chatgpt/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6a08f14ad4155afc3324e75aefc476617f369e9b1a3c3cb76a83bc524da7bfa5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6e7574696c652f6c61726176656c2d636861746770742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/alnutile/laravel-chatgpt/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/dc833961fe5632f5175a2e22dbbbac1c8c73a614d1520add34abf3059fcece9b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c6e7574696c652f6c61726176656c2d636861746770742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alnutile/laravel-chatgpt)

Going to build some basic Driver like clients to talk to different AI service but like with Laravel Storage it will treat them all the same.

- ChatGPT for text
- Jasper when ChatGPT is down :(
- Dall-2
- OpenAI Moderator
- Midjourney - when it gets an api

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

[](#installation)

You can install the package via composer:

```
composer require alnutile/laravel-chatgpt
```

You can then set your .env:

```
AI_CLIENT=sk-key
AI_MOCK=false

```

If you set AI\_MOCK to true it will just return some fixture data so if you are working in your UI for example it will just show that data.

Usage
-----

[](#usage)

Here is an example of

- Call Moderation to see if the text is ok
- TextClientFacade to do a text search with adding a prefix to the request
- SearchResults Event to just let the system know and react to it like make a local copy of the data
- ModerationFailed Event so you can react to that

```
$moderationOk = ModerationClientFacade::checkOk(request()->search);
if ($moderationOk == false) {
    ModerationFailed::dispatch(request());
} else {
        $results = TextClientFacade::addPrefix('can you give me tl;dr terms of service for')->text($search);
        SearchResults::dispatch($results);
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Alfred Nutile](https://github.com/alnutile)
- [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

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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 ~22 days

Total

5

Last Release

1108d ago

### Community

Maintainers

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

---

Top Contributors

[![alnutile](https://avatars.githubusercontent.com/u/365385?v=4)](https://github.com/alnutile "alnutile (29 commits)")

---

Tags

laravellaravel-chatgptalnutile

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/alnutile-laravel-chatgpt/health.svg)

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

###  Alternatives

[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

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

PHPackages © 2026

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