mcmatters/laravel-factory-generators 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mcmatters/laravel-factory-generators

Composer 安装命令:

composer require mcmatters/laravel-factory-generators

包简介

README 文档

README

Generate factories for all non-created factories of models.

Installation

composer require mcmatters/laravel-factory-generators

Include the service provider within your config/app.php file.

'providers' => [
    McMatters\FactoryGenerators\ServiceProvider::class,
]

Publish the configuration.

php artisan vendor:publish --provider="McMatters\FactoryGenerators\ServiceProvider"

Then open the config/factory-generators.php and configure paths where your models are locating.

Advanced configuration

Name Description
folders models - path where models are locating
factories - path where factories are locating.
follow_subdirectories Enable this option if your models are in subdirectories and you wish to keep the structure of the folders. For example, if your model has next namespace: App\Models\User\Profile it will generate in your factories folder subdirectory with name User including ProfileFactory.php file.
NOTE: If you enable this option, please specify the root namespace.
model_namespace Requires only, if you enabled option above.
types An array of custom types for DBAL. For example: 'json' => 'string'.
prefix Prefix for factory files.
suffix Suffix for factory files.
skip_columns An array of the global column names for skipping, for example, you may wish to skip created_at and updated_at columns in all models.
skip_models An array of the fully qualified model names for skipping.
skip_model_columns An associative array with skipping columns for specific model. Example: 'App\Models\User' => ['password', 'remember_token'].
align_array_keys If this option will be enabled, all your factories will include aligned array keys.

Usage

Just run the command php artisan factory:generate.

统计信息

  • 总下载量: 142
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固