定制 tomeasterbrook/livewire-fakeable 二次开发

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

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

tomeasterbrook/livewire-fakeable

最新稳定版本:v0.1.2

Composer 安装命令:

composer require tomeasterbrook/livewire-fakeable

包简介

Fill your Livewire component state with realistic fake data during local development.

README 文档

README

Livewire Fakeable

GitHub Workflow Status Total Downloads Latest Version License

Livewire 4. Fill empty component state with Faker while you build — after mount, only on your machine, never overwriting values you already set.

Livewire Fakeable is a focused Laravel package with a simple idea: declare fake data next to your Livewire properties, and let a component hook apply it when it is safe. No seeding scripts scattered across mount() methods, and no guessing whether you are looking at real or dummy data.

Installation

composer require tomeasterbrook/livewire-fakeable

The service provider is discovered automatically. Publish the config if you want to change locale, hosts, or the on-page indicator:

php artisan vendor:publish --tag="livewire-fakeable-config"

Quick start

Annotate public properties with #[Fakeable] and a Faker formatter name. Empty properties are filled after mount — only in local dev, never overwriting values you already set.

use Livewire\Component;
use TomEasterbrook\LivewireFakeable\Attributes\Fakeable;

class EditProfilePage extends Component
{
    #[Fakeable('name')]
    public string $name = '';

    #[Fakeable('safeEmail')]
    public string $email = '';

    #[Fakeable('paragraph')]
    public string $bio = '';
}

Use #[Fakeable] without a formatter to infer one automatically from the property name, type, or enum.

See the full documentation for array shapes, state classes, Form objects, seeds, locale, and more.

Safety

Faking only runs when all of these are true — otherwise the package does nothing:

  • enabled is true in config
  • App environment is local
  • Request host matches an allowed_hosts glob (e.g. *.test)
  • Faker\Generator is available

Testing

composer test

Changelog

Please see CHANGELOG.

Contributing

Please see CONTRIBUTING.

Security

Please see our security policy.

Credits

License

Livewire Fakeable is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

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