princenoman/laravel-rocket 问题修复 & 功能扩展

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

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

princenoman/laravel-rocket

最新稳定版本:1.0.1

Composer 安装命令:

composer require princenoman/laravel-rocket

包简介

A Laravel package to generate multiple models, migrations, controllers, requests, factories, and seeders in one command.

README 文档

README

Laravel Rocket

laravel-rocket is a Laravel package that provides a set of commands to generate multiple resources (controllers, models, migrations, requests, factories, and seeders) in one go, allowing you to streamline your Laravel development process.

Features

  • Generate multiple controllers, models, migrations, requests, factories, and seeders with a single command.

  • Option to create resource controllers.

  • Supports Laravel 9 or above.

Installation

Step 1: Install the package in development, you can use the --dev flag

composer require prince/laravel-rocket --dev

Step 2: Publish the Configuration (if needed) If your package has any configuration files, you can publish them using:

php artisan vendor:publish --provider="Prince\LaravelRocket\LaravelRocketServiceProvider"

Step 3: Register the Service Provider (for Laravel 10 or below) If you are using Laravel 9 or below, you may need to register the service provider manually in your config/app.php file:

'providers' => [
    // Other Service Providers

    Prince\LaravelRocket\LaravelRocketServiceProvider::class,
],

Usage

The package provides several artisan commands to create multiple resources at once.

  1. Create Multiple Controllers in one command:
php artisan make:controllers Product Order Invoice

This command will generate:

ProductController
OrderController
InvoiceController
  1. Create Resource Controllers in one command, use the --resource or -r option:
php artisan make:controllers Product Order Invoice -r

This will create:

ProductController (as a resource controller)
OrderController (as a resource controller)
InvoiceController (as a resource controller)

Creating controller in nested folder will also work as like we do in traditional Laravel app.

php artisan make:controllers Backend/Product Backend/Order Backend/Invoice

php artisan make:controllers Backend/Blog Frontend/Post

Note that Nested Folder will work for all of the mentioned resources of this package.

  1. Create Multiple Models in one command:
php artisan make:models Product Order Invoice

This will create:

Product model
Order model
Invoice model

Optionally, to create models with migrations:

php artisan make:models Product Order Invoice -m
  1. Create Multiple Migrations for multiple models in one command:
php artisan make:migrations Product Order Invoice
  1. Create Multiple Form request classes in one command:
php artisan make:requests CreateProductRequest UpdateProductRequest
  1. Create Multiple Factories in one command:
php artisan make:factories Product Order Invoice
  1. Create Multiple Seeders in one command:
php artisan make:seeders Product Order Invoice
  • Contributing

    Contributions are welcome! If you find any bugs or want to add new features, feel free to open an issue or submit a pull request.

License The laravel-rocket package is open-source software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-07