Download the PHP package salehhashemi/laravel-intelli-db without Composer
On this page you can find all versions of the php package salehhashemi/laravel-intelli-db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download salehhashemi/laravel-intelli-db
More information about salehhashemi/laravel-intelli-db
Files in salehhashemi/laravel-intelli-db
Package laravel-intelli-db
Short Description An AI-driven Laravel package for generating and managing database related things.
License MIT
Homepage https://github.com/salehhashemi1992/laravel-intelli-db
Informations about the package laravel-intelli-db
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.
Features
The following commands are implemented in this package:
ai:rule
- Generate custom validation rules using AIai:migration
- Generate migration files using AIai:factory
- Generate factory files using AIai: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
-
Install the package via composer:
-
Publish the configuration file:
-
Add your OpenAI API key to the
.env
file: - Optionally, you can change the default model used by OpenAI in the
.env
file:
To adjust the behavior of the AI text generation, you can set the following parameters in your configuration file:
Usage
ai:rule
To create a new validation rule using AI, run the following command:
You can provide the description of the rule using the --description
option:
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
To create a new migration file using AI, run the following command:
You can provide the description of the migration using the --description
option:
You can also specify the table name for the migration with the --table
option:
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:
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
To create a new factory file using AI, run the following command:
You can provide the name of the model for which the factory will be created using the --model
option:
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
To create a new model file using AI, run the following command:
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
ai:rule
To create a rule that validates a unique email address, run:
ai:migration
To create a migration that adds an email column to the users table, run:
ai:factory
To create a factory for the User model, run:
ai:model
To create a model named Address, run:
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Saleh Hashemi
- All Contributors
License
The MIT License (MIT). Please see License File for more information.