From 27ef6b9d31b457d3a6481ebbd168b68f84949353 Mon Sep 17 00:00:00 2001 From: Silverhand <30499443+silverhand7@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:52:24 +0800 Subject: [PATCH 1/2] Update README.md --- README.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7b07d30..07d3e06 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A simple package that can help you to create a boilerplate of a service or actio ## Installation ```bash -composer require silverhand7/laravel-artisan-maker dev-main +composer require silverhand7/laravel-artisan-maker ``` ## Usage @@ -14,11 +14,42 @@ 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 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/{YourService}.php \ +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 action will be created and can be found at app/Contracts/{YourInterface}.php \ +For example: `php artisan make:interface UserService` + +## Custom your generated file location +You can easily customize where you want to locate your Service, Action, or Interface 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' +``` +Your next generated service will be in the `app/MyOwnServices` folder and your namespace for service will be `App\MyOwnServices`. + + + + From ad9df096bfcee4d211bd31cb2208140ca2ab767a Mon Sep 17 00:00:00 2001 From: Silverhand <30499443+silverhand7@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:54:05 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 07d3e06..a834856 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Laravel Artisan Maker -A simple package that can help you to create a boilerplate of a service or action class. +A simple package that can help you create a boilerplate of a service, action, or interface class with artisan command. ## Installation ```bash