joy2362/service-generator

A set of tools to make working with service easier in Laravel

3.1.15 2023-11-15 10:20 UTC

README

A set of tools to make working with service easier in Laravel

Latest Version MIT Licensed Total Downloads

Top features:

  • Creates trait by using artisan command
  • Creates service by using artisan command
  • Creates controller service by using artisan command
  • Add common functions that require to create API

Installation

You can install this package using Composer.

composer require joy2362/service-generator

Publish lang file:

php artisan vendor:publish --tag="service-generator-stub"

Publish stub file:

php artisan vendor:publish  --tag="service-generator-lang"

Usage

1. Create trait

File location app/trait

php artisan make:trait NotifiableTrait

2. Create service

File location app/service

php artisan make:service CategoryService

3. Create controller service

i. create controller and service file only

File location app/service && app/Http/Controllers

php artisan make:c-s Category

ii. create controller and service with API crud operation

File location app/service && app/Http/Controllers && app/Http/Requests

php artisan make:c-s Category --api

Tip: if the name matches with any model then it will generate crud operation

Changelog

Please see Releases for more information on what has changed recently.

Contributing

Pull requests are more than welcome. You must follow the PSR coding standards.

Security

If you discover any security-related issues, please email abdullahzahidjoy@gmail.com instead of using the issue tracker.