vishnu/fillable-generator
最新稳定版本:v0.0.2
Composer 安装命令:
composer require vishnu/fillable-generator
包简介
Laravel package to generate fillable arrays for Eloquent models
README 文档
README
Fillable Generator is a Laravel package that simplifies the process of generating fillable arrays for Eloquent models based on migration files.
Installation
You can install the Fillable Generator package via Composer. Run the following command in your Laravel project directory:
composer require vishnu/fillable-generator
Usage
Generating Fillable Arrays
To generate fillable arrays for your models, use the fillable:g Artisan command provided by the Fillable Generator package.
php artisan fillable:g
Follow the on-screen prompts to enter the path to your migration file and the name of the corresponding model. The command will parse the migration file, extract the column names, and generate a fillable array for the specified model.
Example
Let's walk through an example of using the Fillable Generator package:
-
Suppose you have a migration file named
create_users_table.phplocated in thedatabase/migrationsdirectory. -
Run the
fillable:gcommand and enter the path to the migration file when prompted:php artisan fillable:g
Example prompt:
Enter the migration file path (e.g., database/migrations/2024_04_07_183244_create_users_table.php): -
Next, enter the name of the corresponding model (e.g.,
User):Enter the model name (e.g., User): -
The command will generate a fillable array for the
Usermodel based on the columns defined in the migration file and update the model file accordingly.
Support
If you encounter any issues or have questions about using the Fillable Generator package, please open an issue on GitHub.
License
The Fillable Generator package is open-source software licensed under the MIT license.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-11