alirezappeto/entity-generator 问题修复 & 功能扩展

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

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

alirezappeto/entity-generator

最新稳定版本:v1.0.5

Composer 安装命令:

composer require alirezappeto/entity-generator

包简介

A Laravel package to generate entity files

README 文档

README

A developer-friendly Laravel package to instantly generate fully-structured entities — including Model, Controller, Repository (with Interface & Cache), Resource, Request, and Migration — all based on a clean Repository Pattern. Built-in support for tagged caching makes it perfect for scalable Laravel APIs.

⚙️ Features

  • ✅ One command to generate an entire entity stack
  • ✅ Repository pattern structure with interface segregation
  • ✅ Optional CacheRepository included for performance
  • ✅ Generates:
    • Model (extends BaseModel)
    • Controller (API-ready)
    • Requests (Add, Update, All)
    • API Resource
    • Repositories: Interface + Eloquent + Cache
    • Migration
  • ✅ Auto-binds interface to CacheRepository in your RepositoryServiceProvider
  • ✅ Stub-driven — customize everything

🚀 Installation

    composer require alirezappeto/entity-generator

after installation the package you have to initialize the package utils

    php artisan entity-generator:install

This will generate:

  • app/Models/BaseModel.php
  • app/Repository/BaseRepository.php
  • app/Repository/BaseCacheRepository.php
  • app/Repository/BaseRepositoryInterface.php
  • and ...

Generate an entity

   php artisan make:entity Product

this command will generate for you these files

  • app/Models/Product.php
  • app/Http/Controllers/ProductController.php
  • app/Http/Resources/ProductResource.php
  • app/Http/Requests/Products/AddProductRequest.php
  • app/Repositories/Product/ProductRepositoryInterface.php
  • app/Repositories/Product/ProductRepository.php
  • app/Repositories/Product/ProductCacheRepository.php
  • database/migrations/xxxx_xx_xx_create_products_table.php

🧱 Repository Pattern

This package uses a clean layered architecture:

  • Controller
  • → Request Validation
  • → Repository Interface
  • → Cache Repository
  • → Base Repository (Eloquent)

⚠️ Cache Notes

Ensure your cache driver supports tags:

  • ✅ CACHE_DRIVER=redis

统计信息

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

GitHub 信息

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

其他信息

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