承接 silverhand7/laravel-artisan-maker 相关项目开发

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

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

silverhand7/laravel-artisan-maker

最新稳定版本:v3.0.1

Composer 安装命令:

composer require silverhand7/laravel-artisan-maker

包简介

A simple package that can help you to create a boilerplate of a service or action class.

README 文档

README

A simple package that can help you create a boilerplate of a service, action, interface and facade class with artisan command.

Example usage:

php artisan make:action UserStoreAction
php artisan make:service UserService
php artisan make:interface UserServiceInterface
php artisan make:facade UserFacade 

Installation

composer require silverhand7/laravel-artisan-maker

Usage

Create a service class:

Run the following command:

php artisan make:service {YourService}

The service will be created and can be found at app/Services/{YourService}.php
For example: php artisan make:service UserService

Additionally, you can create a service that implements an interface class

php artisan make:service {YourService} --interface={YourInterface}

or

php artisan make:service {YourService} -i {YourInterface}

Create an action class:

Run the following command:

php artisan make:action {YourAction}

The action will be created and can be found at app/Actions/{YourAction}.php
For example: php artisan make:action UserStoreAction

Create an interface class:

Run the following command:

php artisan make:interface {YourInterface}

The interface will be created and can be found at app/Contracts/{YourInterface}.php
For example: php artisan make:interface UserServiceInterface

Create a facade class:

Run the following command:

php artisan make:facade {YourFacade}

The facade will be created and can be found at app/Facades/{YourFacade}.php
For example: php artisan make:facade UserFacade

Custom your namespace and generated file location

You can easily customize where you want to locate your Service, Action, Interface or Facade class. You can do that by publishing the config file using the following command:

php artisan vendor:publish --tag=artisan-maker-config

You can customize it in config/artisan-maker.php, for example:

'service_interface' => 'App\MyOwnServices'
'service_directory' => 'app/MyOwnServices'

Your next generated service will be in the app/MyOwnServices folder and your namespace for service will be App\MyOwnServices.

统计信息

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

GitHub 信息

  • Stars: 23
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

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