jiordiviera/laravel-task-automator 问题修复 & 功能扩展

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

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

jiordiviera/laravel-task-automator

最新稳定版本:v1.0.1

Composer 安装命令:

composer require jiordiviera/laravel-task-automator

包简介

A Laravel package for automating repetitive tasks

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License Tests Status

Laravel Task Automator is a powerful Laravel package designed to supercharge your workflow by automating repetitive tasks like CRUD generation, authentication setup, seeder creation, API configuration, and more. Save time and focus on what truly matters—building awesome applications. 🚀

✨ Features

  • CRUD Generation: Quickly generate CRUD scaffolding with models, controllers, migrations, views, and more.
  • API & Web Ready: Supports both web-based and API-based controllers.
  • Advanced Options: Includes seeding, form requests, policies, and testing capabilities.
  • Developer Productivity: Generate files effortlessly and keep your application organized.

🚀 Installation

First, add Laravel Task Automator to your Laravel project using Composer:

composer require jiordiviera/laravel-task-automator

Once installed, you can use the make:crud command to generate various components for your application.

📜 Usage

Laravel Task Automator makes it easy to generate a complete CRUD setup with just a single command:

php artisan make:crud {name} {--fields=} {--api} {--force} {--seed} {--policy} {--requests} {--resource} {--test}

Arguments & Options:

  • name (required): The name of the model. Example: Post, User.
  • --fields: Fields for the migration in the format: name:type,name:type,.... Example: title:string,content:text.
  • --api: Generate API-based controller and routes instead of web.
  • --force: Force overwrite existing files if they already exist.
  • --seed: Generate a seeder for the model.
  • --policy: Generate a policy for the model.
  • --requests: Generate form request classes for validation.
  • --resource: Generate an API resource.
  • --test: Generate feature or unit tests.

Example Command:

php artisan make:crud Post --fields="title:string,content:text,is_published:boolean" --seed --policy --api

This command will generate:

  • A Post model.
  • A migration for the posts table with the specified fields.
  • An API Controller (PostController) and corresponding routes.
  • Views (if --api is not specified).
  • A Seeder (PostSeeder).
  • A Policy (PostPolicy).
  • Form Request validation classes (StorePostRequest, UpdatePostRequest).
  • An API Resource (PostResource).
  • Feature or unit tests.

🛠️ Generated Files

Laravel Task Automator generates a complete set of files, customized to your application. Here’s a quick look at the generated components:

1. Model 🗂️

Path: app/Models/Post.php

The model is equipped with fillable properties based on the fields you specify.

2. Migration 📅

Path: database/migrations/YYYY_MM_DD_HHMMSS_create_posts_table.php

The migration is automatically set up with all specified fields.

3. Controller 🖇️

Path: app/Http/Controllers/PostController.php

Depending on the --api flag, either a web or API-based controller is generated with all CRUD methods.

4. Views (Optional) 👁️

Paths:

  • resources/views/post/index.blade.php
  • resources/views/post/create.blade.php
  • resources/views/post/edit.blade.php
  • resources/views/post/show.blade.php

Only generated if the --api flag is not set.

5. Routes 🚦

You’ll be prompted to add the generated routes to your application. You can add them to either the web or API routes file.

6. Seeder 🌱

Path: database/seeders/PostSeeder.php

This seeder uses Faker to populate your database with random but sensible data.

7. Policy 🔒

Path: app/Policies/PostPolicy.php

Generated to handle authorization for your model’s actions.

8. Form Requests 📜

Paths:

  • app/Http/Requests/StorePostRequest.php
  • app/Http/Requests/UpdatePostRequest.php

Handles validation logic for storing and updating the model.

9. API Resource 🌐

Path: app/Http/Resources/PostResource.php

Generated for transforming your model’s data in API responses.

10. Tests 🧪

Paths:

  • tests/Feature/PostTest.php (or tests/Unit/PostTest.php for API)

Automatically generated feature or unit tests, making it easy to validate your generated CRUD.

📝 Advanced Usage

Using Stubs

You can customize your own stubs for more control over the generated code. Laravel Task Automator uses stub files located in stubs/. Feel free to modify these to match your project’s style and standards.

To publish the stubs for customization:

php artisan vendor:publish --tag=laravel-task-automator-stubs

Edit the stubs to suit your needs, and Laravel Task Automator will use your versions for code generation.

⚙️ Configuration

Laravel Task Automator is designed to work out-of-the-box, but there are a few things you might want to adjust for a more tailored experience.

Customizing Routes

You can modify the generated route template as per your app’s structure. You’ll find the routes in the stub files under stubs/routes/.

Form Requests

Validation rules are generated automatically based on the provided fields, but you can edit the form request classes to add custom validation rules, messages, or other logic.

🛠️ Contributing

Contributions are welcome! If you have ideas, bug fixes, or improvements, please feel free to submit a pull request or open an issue on GitHub.

GitHub Repository

📝 License

Laravel Task Automator is open-sourced software licensed under the MIT license.

🫶 Acknowledgments

Special thanks to the Laravel community for creating an amazing framework that makes building web applications a joyful experience.

Feel free to enhance your development journey with Laravel Task Automator! Happy coding! 🎉🚀

jiordiviera/laravel-task-automator 适用场景与选型建议

jiordiviera/laravel-task-automator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 09 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「generator」 「task」 「crud」 「laravel」 「automator」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 jiordiviera/laravel-task-automator 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-24