PHPackages                             kimani/laravel-ai-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. kimani/laravel-ai-faker

ActiveLibrary

kimani/laravel-ai-faker
=======================

A Laravel package to generate realistic fake data using AI.

10PHP

Since Jan 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kimani-dev/laravel-ai-faker)[ Packagist](https://packagist.org/packages/kimani/laravel-ai-faker)[ RSS](/packages/kimani-laravel-ai-faker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel AI Faker
================

[](#laravel-ai-faker)

Laravel AI Faker is a package that enhances Laravel's default Faker functionality by leveraging AI to generate realistic, context-aware fake data. This package scans your models, analyzes their attributes and relationships, and produces meaningful data for development and testing environments.

---

Features
--------

[](#features)

- **AI-Powered Data Generation**: Generates more realistic fake data using AI (e.g., OpenAI).
- **Model Analysis**: Automatically detects model attributes and relationships to provide context-aware data.
- **Seamless Integration**: Works seamlessly with Laravel factories and database seeding.
- **Configurable**: Customize AI prompts and settings for tailored results.

---

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

[](#installation)

Require the package via Composer:

```
composer require kimani/laravel-ai-faker
```

If you're using AI services like OpenAI, publish the configuration file:

```
php artisan vendor:publish --provider="Kimani\AIFaker\AIFakerServiceProvider"
```

Then, add your API key to the configuration file or `.env` file:

```
AIFAKER_API_KEY=your-api-key-here
```

---

Usage
-----

[](#usage)

### Generating Fake Data

[](#generating-fake-data)

Use the `AIFaker` service in your factories:

```
use Kimani\AIFaker\Services\AIFaker;

$aiFaker = app(AIFaker::class);

return $aiFaker->generateFakeData(new \App\Models\YourModel());
```

### Example Factory Integration

[](#example-factory-integration)

In your Laravel factory:

```
use Kimani\AIFaker\Services\AIFaker;

/** @var \Kimani\AIFaker\Services\AIFaker $aiFaker */
$aiFaker = app(AIFaker::class);

\App\Models\YourModel::factory()->define(function () use ($aiFaker) {
    return $aiFaker->generateFakeData(new \App\Models\YourModel());
});
```

---

Configuration
-------------

[](#configuration)

The configuration file (`config/aifaker.php`) allows you to customize:

- AI provider and API key
- AI model and parameters
- Default behavior for data generation

---

Testing
-------

[](#testing)

Run the tests with:

```
vendor/bin/phpunit
```

---

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

[](#contributing)

Contributions are welcome! Please submit a pull request or open an issue to report bugs or suggest features.

---

License
-------

[](#license)

This package is open-source and licensed under the [MIT License](LICENSE).

---

Credits
-------

[](#credits)

Developed by David Kimani.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/adafb6fcc5c5de32f456189684dee9556c485b2f3204beca4e7026bc0b925e7a?d=identicon)[kimani-dev](/maintainers/kimani-dev)

---

Top Contributors

[![kimani-dev](https://avatars.githubusercontent.com/u/64257312?v=4)](https://github.com/kimani-dev "kimani-dev (4 commits)")

### Embed Badge

![Health badge](/badges/kimani-laravel-ai-faker/health.svg)

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

PHPackages © 2026

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