承接 timwassenburg/laravel-improved-resource-controllers 相关项目开发

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

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

timwassenburg/laravel-improved-resource-controllers

最新稳定版本:v1.0.4

Composer 安装命令:

composer require timwassenburg/laravel-improved-resource-controllers

包简介

Generate complete resource controllers

README 文档

README

Logo

Latest Version on Packagist Total Downloads License

Table of Contents

  1. Features
  2. Getting started
  3. Usage
  4. Variables
  5. More generator packages
  6. Contributing
  7. License

Features

This simple package extends the php artisan make:controller command and generates resource controllers with working resource functions out of the box to prevent you from writing the same basic controller functions over and over again. Keep in mind the improved resource controllers are only meant as a starting point. You still have to add your own routes, validation, migrations, etc.

Getting started

Installation

Require the package with composer.

composer require timwassenburg/laravel-improved-resource-controllers --dev

Publish config (optional)

php artisan vendor:publish --provider="TimWassenburg\ImprovedResourceControllers\ImprovedResourceControllersServiceProvider" --tag="config"

Publish stubs (optional)

To change the generated resource controllers you can override the stubs and adjust it to your liking. The stubs will be stored in /resources/stubs.

php artisan vendor:publish --provider="TimWassenburg\ImprovedResourceControllers\ImprovedResourceControllersServiceProvider" --tag="stubs"

Usage

The idea behind this package is that you can keep using the make:controller commands you are already used to. So no need to change your muscle memory. Checkout the example output to see the result for each command.

Default resource controller

php artisan make:controller CustomerController --resource

Example output

Default API resource controller

php artisan make:controller CustomerController --resource --api

Example output

Model resource controller

php artisan make:controller CustomerController --resource --model=Customer

Example output

Model API resource controller

php artisan make:controller CustomerController --resource --model=Customer --api

Example output

Nested resource controller

php artisan make:controller CityController --resource --parent=Country --model=City

Example output

Nested API resource controller

php artisan make:controller CityController --resource --parent=Country --model=City --api

Example output

Variables

In the stubs you can use the following variables.

General

Variable Output
{{ namespace }} App\Http\Controllers
{{ namespacedModel }} App\Models\Order
{{ class }} OrderController
{{ model }} Order
{{ modelVariable }} order
{{ modelVariablePlural }} orders

With parent (--parent=Customer)

Variable Output
{{ namespacedParentModel }} App\Models\Customer
{{ parentModelVariable }} customer
{{ parentModelVariablePlural }} customers

More generator packages

Looking for more ways to speed up your workflow? Make sure to check out these packages.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固