thuraaung2493/laravel-make-files-tools

一个用于为 Laravel 项目创建 DTO、Action 和 Service 类的小型 CLI 工具。

dev-main 2023-05-27 09:34 UTC

This package is auto-updated.

Last update: 2024-09-27 12:28:28 UTC


README

它支持 Laravel 9+ 和 PHP 8.1+

描述

此包是一个用于创建 Action 类、DTO 类和 Service 类的小型 CLI 工具。

安装

Laravel

使用以下命令使用 composer 安装此包

  composer require thuraaung2493/laravel-make-files-tools@dev

用法

创建 DTO 类

  php artisan make:dto NewUser --pest

  // created in App\DataObjects\NewUser.php & tests/Feature/DataObject/NewUserTest.php

创建 Action 类

  php artisan make:action CreateUserAction --pest

  // created in App\Actions\CreateUserAction.php & tests/Feature/Actions/CreateUserActionTest.php

创建 Service 类

  php artisan make:service NotificationService --pest

  // created in App\Services\NotificationService.php & tests/Feature/Services/NotificationServiceTest.php