承接 coding-partners/auto-controller 相关项目开发

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

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

coding-partners/auto-controller

Composer 安装命令:

composer require coding-partners/auto-controller

包简介

The "Auto Controller" package for Laravel allows you to quickly generate fully functional controllers for any model in your application. With a single command, the package will create a controller with all the standard CRUD (Create, Read, Update, Delete) methods, saving you significant time and effo

README 文档

README

Description

coding-partners/auto-controller is a Laravel package allows you to quickly create fully functional controllers for any model in your project. With a single command, the package will create a console with all standard CRUD methods (create, read, update, delete) as well as soft-delete methods, saving you a lot of time and effort. This enables you to focus on building the core features of your project. And let's not forget its support for uploading all types of files with high security

Installation

To install the package, use the following command via Composer:

composer require coding-partners/auto-controller

Requirements

  • PHP version 8.0 or higher is required.

Usage

To use the package: You must first set up the model and migration. For file fields:

  • You must add the suffix _img to the image field. EX: image_img
  • You must add the suffix _vid to the video field. EX: video_vid
  • You must add the suffix _aud to the audio field, EX: audio_aud
  • You must add the suffix _docs to the document, EX: file_docs
    public function up(): void
  {
      Schema::create('files', function (Blueprint $table) {
          $table->id();
          $table->string('image_img');
          $table->string('video_vid');
          $table->string('audio_aud');
          $table->string('file_docs');
          $table->timestamps();
      });
  }

After ensuring that you have performed all the previous steps, you can run the following command via the Artisan Console:

php artisan crud:generate ModelName

Workflow:

  1. The command will generate FormRequest classes for the Store and Update operations.
  2. It will then generate an API Resource file for the model.
  3. You will be prompted to choose whether to add a Service layer:
    • If you answer yes, a Service file specific to the controller will be generated, followed by the controller.
    • If you answer no, only the controller will be generated.
  4. Finally, the necessary routes will be added to the api.php file.

Example with Service

EUROPELAPTOP@DESKTOP-P3SVV3J MINGW64 /d/CRUD
$ php artisan crud:generate Post
Generating store FormRequest for Post...
FormRequest StorePostRequest created successfully in folder PostRequest.
Generating update FormRequest for Post...
FormRequest UpdatePostRequest created successfully in folder PostRequest.

 Do you want to generate a Service for Post? (yes/no) [no]:
 > yes

Generating Service for Post...
Service PostService created successfully.
Generating CRUD with service for Post...
Controller PostController created successfully.
Generating routes/api.php for Post...
Post Route added successfully.

Example without Service

EUROPELAPTOP@DESKTOP-P3SVV3J MINGW64 /d/CRUD
$ php artisan crud:generate User
Generating store FormRequest for User...
FormRequest StoreUserRequest created successfully in folder UserRequest.
Generating update FormRequest for User...
FormRequest UpdateUserRequest created successfully in folder UserRequest.
Generating Resource for User...
Resource UserResource created successfully.

 Do you want to generate a Service for User? (yes/no) [no]:
 >

Generating CRUD without service for User...
Controller UserController created successfully.
Generating routes/api.php for User...
User Route added successfully.

License

This package is licensed under the MIT License.

Contributions

Contributions are welcome! If you'd like to contribute to the development of this package, you can start by opening an Issue or submitting a Pull Request.

Authors

  • YousefSaleh1
  • Ayham-Ibrahim

coding-partners/auto-controller 适用场景与选型建议

coding-partners/auto-controller 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 45 次下载、GitHub Stars 达 4, 最近一次更新时间为 2024 年 08 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 coding-partners/auto-controller 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 coding-partners/auto-controller 我们能提供哪些服务?
定制开发 / 二次开发

基于 coding-partners/auto-controller 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-30