承接 smousss/laravel-factorize 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

smousss/laravel-factorize

最新稳定版本:0.1.3

Composer 安装命令:

composer require smousss/laravel-factorize

包简介

Effortlessly generate Laravel factories for all your models using GPT-4!

README 文档

README

Factorize

Magically add missing Model Factories

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Smousss generates missing Model Factories to help you create fake data seeders and write tests at ease. A dream came true for developers inheriting legacy codebases.

namespace Database\Factories;

use 

class ThreadFactory extends Factory
{
    public function definition()
    {
        return [
            'title' => fake()->sentence(),
            'slug' => fake()->slug(),
            'content' => fake()->paragraph(),
        ];
    }

    public function withUser(): static
    {
        return $this->state(function () {
            return [
                'user_id' => User::factory(),
            ];
        });
    }

    …
}

Installation

Install the package via Composer:

composer require smousss/laravel-factorize

Publish the config file:

php artisan vendor:publish --tag=factorize-config

Usage

  1. First, generate a secret key on smousss.com.
  2. Add it to your SMOUSSS_SECRET_KEY environment variable.
  3. Then, create a factory for your Post model: php artisan smousss:factorize App\\Models\\Post. Or for multiple models: php artisan smousss:factorize App\\Models\\Post App\\Models\\Comment

Credit

Factorize for Laravel has been developed by Benjamin Crozat for Smousss (Twitter).

License

MIT

统计信息

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

GitHub 信息

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

其他信息

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