承接 gomaa/base 相关项目开发

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

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

gomaa/base

最新稳定版本:2.1.6

Composer 安装命令:

composer require gomaa/base

包简介

Greet - A simple Package Base

README 文档

README

Latest Version on Packagist Total Downloads

gomaa/base is a Laravel package that provides base commands and helpers to speed up development.
It helps you quickly generate DTOs, Mappers, Services, and more following clean architecture principles.

🚀 Installation

Install the package via Composer:

composer require gomaa/base

⚡ Available Commands

1. Generate CRUD Files

You can quickly generate a full CRUD module (Model, Migration, Controller, Service, Routes, etc.) using:

php artisan crud:all

This will create a full module for the Product entity with the following structure:

"Product": {
    "fillables": {
      "id": "bigIncrements",
      "category_id": "unsignedBigInteger",
      "name": "string",
      "slug": "string|unique",
      "description": "text|nullable",
      "price": "decimal(10,2)",
      "stock": "integer",
      "is_active": "boolean|default:true",
      "created_at": "timestamp",
      "updated_at": "timestamp"
    }
  },

2. Route Registration

Make sure your routes/api.php includes the following snippet to automatically load all module routes:

foreach (glob(base_path('app/Http/Modules').'/*/Route/index.php') as $routeFile) {
    require $routeFile;
}

This ensures that all generated CRUD routes are registered automatically.

⚡ What crud:all Post Generates

Running the command:

php artisan crud:all Post

Will automatically generate a full module for the Post entity, including:

Model (with defined $fillable properties) Migration (with proper schema fields) Controller (with CRUD endpoints) Service (for business logic) Route (auto-registered in routes/api.php) Mapper (to map between Model ↔ DTO) DTO (Data Transfer Object for the entity) Requests (Form Request classes for Create, Update, Show, etc.) Example Post definition

{
  "Post": {
    "fillables": {
      "id": "int",
      "title": "string",
      "content": "text",
      "user_id": "unsignedBigInteger",
      "is_published": "boolean"
    }
  }
}

🛠 Requirements

  • PHP >= 8.1
  • Laravel >= 10.x
  • Composer >= 2.x

🤝 Contributing

Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.

If you're contributing, don't forget to run the following:

composer update
git commit -m "Your changes"
git push origin main
git tag 1.0.1
git push -u origin --tags

统计信息

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

GitHub 信息

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

其他信息

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