2017 © Pedro Peláez
 

library serviceman

SOA package for Laravel 5.4.*

image

munza/serviceman

SOA package for Laravel 5.4.*

  • Thursday, March 23, 2017
  • by munza
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 67 % Grown

The README.md

Serviceman

"Because Your Laravel App Needs Special Services!", (*1)

Package for implementing SOA (Service Oriented Architecture) pattern in Laravel 5.4.*** which adds more organized folder structure to joselfonseca/laravel-tactician package. The folder structure can be configured through the **config/serviceman.php file., (*2)

Installation

Set minimum-stability to dev in the composer.json file, (*3)

    "minimum-stability": "dev"

To install this update your composer.json file to require, (*4)

    "require": {
        "joselfonseca/laravel-tactician": "^0.3.*",
        "munza/serviceman" : "0.9.*"
    }

Or run composer require munza/serviceman joselfonseca/laravel-tactician from the command line., (*5)

Once the dependencies have been downloaded, add the service provider to your config/app.php file, (*6)

    'providers' => [
        ...
        Joselfonseca\LaravelTactician\Providers\LaravelTacticianServiceProvider::class,
        Munza\Serviceman\ServicemanServiceProvider::class,
        ...
    ]

Publish the configuration file. Create a new command class (with handler);, (*7)

    php artisan vendor:publish

Usage

Create a new service class:, (*8)

    php artisan make:service User

Create a new command class (with handler):, (*9)

    php artisan make:service:command Register User

Create a new command class (without handler):, (*10)

    php artisan make:service:command Register User --no-handler

Create a new handler class:, (*11)

    php artisan make:service:handler RegisterHandler Register User

Create a new middleware class:, (*12)

    php artisan make:service:middleware RegisterValidator User

Configuration

Edit config/serviceman.php for generator configuration., (*13)

    ...
    'generator'  => [
        'basePath' => app_path(),
        'paths' => [
            'service'    => 'Services',
            'command'    => 'Services\\{{ service }}',
            'handler'    => 'Services\\{{ service }}',
            'middleware' => 'Services\\{{ service }}',
        ],
    ],
    ...

{{ service }} will be replaced with name of the service. For example if following command is used -, (*14)

    php artisan make:service:command Register User

Then, app/Services/User/Register.php file will be generated, where User is the name of the service that has replaced {{ service }}., (*15)

Example

Please check joselfonseca/laravel-tactician packge for more information. Also check https://gist.github.com/joselfonseca/24ee0e96666a06b16f92 for a working example., (*16)

Issues

If you discover any issues, please open an issue using the issue tracker. But take a look at the previous issues before creating a new one to avoid duplication., (*17)

License

The MIT License (MIT). Please see License for more information., (*18)

The Versions

23/03 2017

dev-master

9999999-dev

SOA package for Laravel 5.4.*

  Sources   Download

MIT

The Requires

 

23/03 2017

0.9.0

0.9.0.0

SOA package for Laravel 5.4.*

  Sources   Download

MIT

The Requires