pw-seeder
Use when creating, dispatching, or interacting with Database Seeding in ProcessWire (processwire-console file-based seeders).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating, dispatching, or interacting with Database Seeding in ProcessWire (processwire-console file-based seeders).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when building, structuring, or refactoring native backend modules for ProcessWire using PHP 8.4 and strict typing.
Use when designing, structuring, or rendering HTML for ProcessWire Admin interfaces, custom Process modules, or Inputfields.
Use when brainstorming or designing ProcessWire modules, templates, field schemas, or hooks to resolve ambiguity and validate architecture before implementation.
Use when creating, executing, or managing Pest tests within ProcessWire or ProcessWire modules, including Test-Driven Development (TDD) tasks.
Use when encountering any bug, test failure, blank screen of death, or unexpected behavior in ProcessWire before proposing fixes.
Use when creating or updating module documentation, package READMEs, architecture guides, or CLI command references for ProcessWire projects.
| name | pw-seeder |
| description | Use when creating, dispatching, or interacting with Database Seeding in ProcessWire (processwire-console file-based seeders). |
| risk | moderate |
| source | processwire-boost |
| date_added | 2026-04-09 |
This project implements a Laravel-style database seeding system for ProcessWire via the processwire-console package. It includes built-in auto-discovery of seeder classes and integration with FakerPHP.
site/seeders/*Seeder.php (global) or site/modules/[ModuleName]/seeders/*Seeder.php (module-scoped).Seeder (e.g., UsersSeeder) and match their filenames (UsersSeeder.php).Totoglu\Console\Database\Seeder.A basic seeder class overrides the run() method.
<?php
declare(strict_types=1);
namespace Site\Seeders;
use Totoglu\Console\Database\Seeder;
use ProcessWire\Page;
class UsersSeeder extends Seeder
{
public function run(): void
{
// Example: Seeding from JSON
// $json = json_decode(file_get_contents(__DIR__ . '/users.json'), true);
for ($i = 0; $i < 10; $i++) {
$p = new Page();
$p->template = 'user';
$p->parent = $this->wire->users->getPage();
// Note: $this->faker is null unless fakerphp/faker is installed via composer.
$p->name = "user-{$i}";
$p->addStatus(Page::statusActive);
$p->save();
}
}
}
wire make:seeder {Name} - Create a new seeder class in site/seeders/.wire make:seeder {Name} --module=MyModule - Create a seeder specifically inside a module.wire db:seed - Run all discovered seeders or a specific one with --class=UsersSeeder.$database->exec() logic when ProcessWire\Page objects cover the requirements. Native API honors hooks and formatting.FakeUsers.php. It MUST end with Seeder.php or it won't be auto-discovered.