laravel-shift/factory-generator 问题修复 & 功能扩展

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

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

laravel-shift/factory-generator

最新稳定版本:v2.2

Composer 安装命令:

composer require --dev laravel-shift/factory-generator

包简介

Generate factories from existing models

README 文档

README

This package generates model factories from existing models using the new class-based factories introduced in Laravel 8.

Installation

You may install this package via composer by running:

composer require --dev laravel-shift/factory-generator

The package will automatically register itself using Laravel's package discovery.

Usage

This package adds an artisan command for generating model factories.

Without any arguments, this command will generate model factories for all existing models within your Laravel application:

php artisan generate:factory

Similar to Laravel, this will search for models within the app/Models folder, or if that folder does not exist, within the app folder.

To generate factories for models within a different folder, you may pass the --path option (or -p).

php artisan generate:factory --path=some/Other/Path

To generate a factory for a single model, you may pass the model name:

php artisan generate:factory User

By default nullable columns are not included in the factory definition. If you want to include nullable columns you may set the --include-nullable option (or -i).

php artisan generate:factory -i User

Attribution

This package was original forked from Naoray/laravel-factory-prefill by Krishan König.

It has diverged to support the latest version of Laravel and to power part of the automation by the Tests Generator.

Contributing

Contributions should be submitted to the master branch. Any submissions should be complete with tests and adhere to the Laravel code style. You may also contribute by opening an issue.

统计信息

  • 总下载量: 628.51k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 50
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 50
  • Watchers: 4
  • Forks: 21
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-29