PHPackages                             salehhashemi/laravel-intelli-db - 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. [Database &amp; ORM](/categories/database)
4. /
5. salehhashemi/laravel-intelli-db

ActiveLibrary[Database &amp; ORM](/categories/database)

salehhashemi/laravel-intelli-db
===============================

An AI-driven Laravel package for generating and managing database related things.

v0.7.0(2y ago)555884[1 issues](https://github.com/salehhashemi1992/laravel-intelli-db/issues)MITPHPPHP ^8.1

Since May 5Pushed 2y ago3 watchersCompare

[ Source](https://github.com/salehhashemi1992/laravel-intelli-db)[ Packagist](https://packagist.org/packages/salehhashemi/laravel-intelli-db)[ Docs](https://github.com/salehhashemi1992/laravel-intelli-db)[ RSS](/packages/salehhashemi-laravel-intelli-db/feed)WikiDiscussions main Synced 1mo ago

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

Laravel IntelliDB
=================

[](#laravel-intellidb)

[![Latest Version on Packagist](https://camo.githubusercontent.com/98e510e18df7358acd205e8e22a576d15e2fdb1e3ef513bcb0df9505e2933cbe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616c656868617368656d692f6c61726176656c2d696e74656c6c692d64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/salehhashemi/laravel-intelli-db)[![Total Downloads](https://camo.githubusercontent.com/a51b6bb0e4551574bf5754c78d32013e9fa19ef898a39b536cbdb0a3566f2d8b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616c656868617368656d692f6c61726176656c2d696e74656c6c692d64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/salehhashemi/laravel-intelli-db)[![GitHub Actions](https://camo.githubusercontent.com/c4affdf086609a44517d859c1745db2f969fbb7c9ff104b2948ad36c884db99f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73616c656868617368656d69313939322f6c61726176656c2d696e74656c6c692d64622f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473)](https://github.com/salehhashemi1992/laravel-intelli-db/actions/workflows/tests.yml)[![GitHub Actions](https://camo.githubusercontent.com/cd573c38f0be155556596c92f86fbe570b66c12069035a0ad16169102a486f75/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73616c656868617368656d69313939322f6c61726176656c2d696e74656c6c692d64622f7374617469632d616e616c797369732e796d6c3f6272616e63683d6d61696e266c6162656c3d7374617469632d616e616c79736973)](https://github.com/salehhashemi1992/laravel-intelli-db/actions/workflows/static-analysis.yml)[![PHPStan](https://camo.githubusercontent.com/f60d96f7c2579690ab6dfa8918f777fe93a02a92301c661eb38a85861a92b780/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org/)

A Laravel package that provides an intelligent way to generate database-related components using OpenAI.

It extends the default `artisan make` commands in Laravel to automatically generate the content of each component using AI, based on the provided description.

[![Header Image](./assets/header.png)](./assets/header.png)

Features
--------

[](#features)

The following commands are implemented in this package:

- `ai:rule` - Generate custom validation rules using AI
- `ai:migration` - Generate migration files using AI
- `ai:factory` - Generate factory files using AI
- `ai:model` - Generate model files using AI

Stay tuned for future updates as we continue to expand the capabilities of the Laravel Intelli DB package.

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

[](#installation)

1. Install the package via composer:

    ```
    composer require salehhashemi/laravel-intelli-db

    ```
2. Publish the configuration file:

    ```
    php artisan vendor:publish --provider="Salehhashemi\LaravelIntelliDb\LaravelIntelliDbServiceProvider"

    ```
3. Add your OpenAI API key to the `.env` file:

    ```
    OPEN_AI_KEY=your_openai_key

    ```
4. Optionally, you can change the default model used by OpenAI in the `.env` file:

    ```
    OPEN_AI_MODEL=gpt-4

    ```

To adjust the behavior of the AI text generation, you can set the following parameters in your configuration file:

```
'temperature' => 0.7
'frequency_penalty' => 0.2

```

Usage
-----

[](#usage)

### ai:rule

[](#airule)

To create a new validation rule using AI, run the following command:

```
php artisan ai:rule YourRuleName

```

You can provide the description of the rule using the `--description` option:

```
php artisan ai:rule YourRuleName --description="Your rule description"

```

If you don't provide a description, it will ask for it interactively.

The generated rule class will be placed in the `app/Rules` directory.

### ai:migration

[](#aimigration)

To create a new migration file using AI, run the following command:

```
php artisan ai:migration your_migration_name

```

You can provide the description of the migration using the `--description` option:

```
php artisan ai:migration your_migration_name --description="Your migration description"

```

You can also specify the table name for the migration with the `--table` option:

```
php artisan ai:migration your_migration_name --table=your_table_name

```

This will append the schema of the desired table to provide a better result.

And you can set the location where the migration file should be created using the `--path` option:

```
php artisan ai:migration your_migration_name --path=path/to/migrations

```

If you don't provide a description, it will ask for it interactively.

The generated migration file will be placed in the `database/migrations` directory or the specified path.

### ai:factory

[](#aifactory)

To create a new factory file using AI, run the following command:

```
php artisan ai:factory YourFactoryName

```

You can provide the name of the model for which the factory will be created using the `--model` option:

```
php artisan ai:factory YourFactoryName --model="YourModelName"

```

If you don't provide the model, it will ask for it interactively.

The generated factory file will be placed in the `database/factories` directory.

### ai:model

[](#aimodel)

To create a new model file using AI, run the following command:

```
php artisan ai:model YourModelName

```

The generated model file will be placed in the `app/Models` directory.

The generated model will include PHP DocBlock comments for properties, relationships, and methods with appropriate type hints.

Examples
--------

[](#examples)

### ai:rule

[](#airule-1)

To create a rule that validates a unique email address, run:

```
php artisan ai:rule UniqueEmail --description="Validate unique email address"

```

### ai:migration

[](#aimigration-1)

To create a migration that adds an email column to the users table, run:

```
php artisan ai:migration AddEmailToUsersTable --description="Add email column to users table" --table=users

```

### ai:factory

[](#aifactory-1)

To create a factory for the User model, run:

```
php artisan ai:factory UserFactory --model="User"

```

### ai:model

[](#aimodel-1)

To create a model named Address, run:

```
php artisan ai:model Address

```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Saleh Hashemi](https://github.com/salehhashemi1992)
- [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

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.4% 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 ~13 days

Recently: every ~43 days

Total

15

Last Release

922d ago

### Community

Maintainers

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

---

Top Contributors

[![salehhashemi1992](https://avatars.githubusercontent.com/u/81674631?v=4)](https://github.com/salehhashemi1992 "salehhashemi1992 (96 commits)")[![Mohammadreza-73](https://avatars.githubusercontent.com/u/22294125?v=4)](https://github.com/Mohammadreza-73 "Mohammadreza-73 (6 commits)")[![imahmood](https://avatars.githubusercontent.com/u/13146816?v=4)](https://github.com/imahmood "imahmood (2 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

aiartisancmddatabaselaravelopenailaraveldatabaseaimigrationsrulesmodelsfactoriesseederssalehhashemiintelli-db

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/salehhashemi-laravel-intelli-db/health.svg)

```
[![Health](https://phpackages.com/badges/salehhashemi-laravel-intelli-db/health.svg)](https://phpackages.com/packages/salehhashemi-laravel-intelli-db)
```

###  Alternatives

[nwidart/db-exporter

Export your database quickly and easily as a Laravel Migration and all the data as a Seeder class.

37839.1k](/packages/nwidart-db-exporter)[dragon-code/laravel-data-dumper

Adding data from certain tables when executing the `php artisan schema:dump` console command

3418.6k](/packages/dragon-code-laravel-data-dumper)[orptech/laravel-migration-partition

Laravel extensions that extends Illuminate to enable partitioned table creation within Laravel migrations.

3426.7k](/packages/orptech-laravel-migration-partition)[zachleigh/yarak

Laravel inspired devtools for Phalcon. Database migrations, model factories and database seeders.

293.8k](/packages/zachleigh-yarak)

PHPackages © 2026

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