PHPackages                             jake142/laravel-service - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jake142/laravel-service

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jake142/laravel-service
=======================

A package to split a laravel project into smaller services

3.0.9(1y ago)611.6k2[1 PRs](https://github.com/jake142/laravel-service/pulls)MITPHP

Since Sep 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jake142/laravel-service)[ Packagist](https://packagist.org/packages/jake142/laravel-service)[ RSS](/packages/jake142-laravel-service/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (34)Used By (0)

Laravel Service
---------------

[](#laravel-service)

A package to divide Laravel into smaller services. Then main goal of this package is:

1. Readable, the code is split into services
2. Scalable, run services as needed
3. Faster development, split work between developers

#### Installation

[](#installation)

Simply run:

> composer require jake142/laravel-service

#### Usage

[](#usage)

Start by running

> php artisan laravel-service:make

This will start a setup wizard where you define:

1. The name of the service
2. The version of the service (eg. V1)
3. If you want a sample controller (recommended)
4. If you want a sample job (recommended)
5. If you want a sample test (recommended)

The service is now created (added as a repository to your composer.json file), but not enabled.

#### Enable a service

[](#enable-a-service)

To enable a service run:

> php artisan laravel-service:enable laravel-service/$version-$service (eg. laravel-service/v1-sampleservice)

This will enable the service which means:

1. Composer runs require on your service
2. The tests will be added to the phpunit.xml and therefore able to run with the phpunit command

#### Disable a service

[](#disable-a-service)

To disable a service run:

> php artisan laravel-service:disable laravel-service/$version-$service (eg. laravel-service/v1-sampleservice)

This will disable the service which means:

1. Composer runs remove on your service
2. The tests will be removed from the phpunit.xml

#### List services and their status

[](#list-services-and-their-status)

> php artisan laravel-service:list

#### Generic Queues and Jobs

[](#generic-queues-and-jobs)

To call the generic queue:

```
(new GenericQueue('Services\\V1\\Test\\Jobs\\ExampleJob', ['param'=>'test'], $queue = null))->dispatch();
```

To run the generic job:

```
