saicosys/cakephp-fake-data-plugin 问题修复 & 功能扩展

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

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

saicosys/cakephp-fake-data-plugin

最新稳定版本:v1.0.2

Composer 安装命令:

composer require saicosys/cakephp-fake-data-plugin

包简介

Fake data generator plugin for CakePHP

README 文档

README

A lightweight CakePHP 5 plugin to generate and insert fake data into valid models only.

Introduction

Saicosys/FakeData is a CakePHP 5 plugin designed to help developers and testers quickly generate and populate fake data into any existing model. It uses the own dummy content to generating realistic test data, while ensuring only valid models are targeted to maintain safety and structure.

Features

  • Smart model detection — only generates data for existing models.
  • Fully CLI-based — simple to run with options.
  • Supports customizable record count.
  • Perfect for local development, testing, and demo environments.

Use Cases

  • Quickly populate your development database.
  • Simulate large datasets for performance testing.
  • Replace manual data entry with one command.

Installation

  1. Install the Plugin via Composer You can install the plugin using Composer by running the following command at the root of your CakePHP 5 project:
composer require saicosys/cakephp-fake-data-plugin --dev
  1. Load the Plugin

After installation, load the plugin:

bin/cake plugin load Saicosys/FakeData

Usage

List available models

bin/cake fake --list-models

Generate fake data for a model

bin/cake fake <model> <count>

Example:

bin/cake fake users 10

Preview (dry run) fake data

bin/cake fake users 5 --dry-run

Specify custom special fields

bin/cake fake users 10 --special-fields=avatar,logo,thumbnail

Options

  • --list-models, -l : List available models for fake data generation.
  • --dry-run, -d : Show what would be generated without saving to the database.
  • --special-fields, -s : Comma-separated list of additional special fields (e.g., avatar,logo).

License

This plugin is licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-08