定制 meops/laravel-populate 二次开发

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

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

meops/laravel-populate

最新稳定版本:1.0.4

Composer 安装命令:

composer require meops/laravel-populate

包简介

Populate the DB in your Laravel application

README 文档

README

Packagist Tests

An Artisan command for populating your database. It allows you to quickly create records in your database using the model factories you have already defined in your Laravel application without writing seeders.

Installation

Install the package as a development dependency:

composer require --dev meops/laravel-populate

Usage

Records are created by specifying the model whose factory definition should be used to generate field values.

Create a single record

The first argument specifies the model to create. The package will look for a matching model name in the App/Models directory by default:

php artisan db:populate User

Use double backslashes to escape slashes in a fully qualified class name:

php artisan db:populate MyNamespace\\User

Create multiple records

The second argument is optional and specifies the number of records to create:

php artisan db:populate User 10

Create multiple records with custom data

Specify any fields whose values should be overriden using the -o option with the format field=value. Multiple fields can be overriden by providing multiple -o options.

php artisan db:populate User -o email=me@example.com -o password=secret

Prerequisites

Any model you wish to populate must have a factory defined.

统计信息

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

GitHub 信息

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

其他信息

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