定制 vishnu/fillable-generator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. Suppose you have a migration file named create_users_table.php located in the database/migrations directory.

  2. Run the fillable:g command 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):
    
  3. Next, enter the name of the corresponding model (e.g., User):

    Enter the model name (e.g., User):
    
  4. The command will generate a fillable array for the User model 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-11