PHPackages                             shreifelagamy/laravel-service-modules - 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. [Framework](/categories/framework)
4. /
5. shreifelagamy/laravel-service-modules

ActiveLibrary[Framework](/categories/framework)

shreifelagamy/laravel-service-modules
=====================================

Generate modular service architecture for Laravel applications

v2.0.1(8mo ago)482.0k↑21.4%8[2 issues](https://github.com/shreifelagamy/laravel-service-modules/issues)[2 PRs](https://github.com/shreifelagamy/laravel-service-modules/pulls)MITPHP

Since Oct 8Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/shreifelagamy/laravel-service-modules)[ Packagist](https://packagist.org/packages/shreifelagamy/laravel-service-modules)[ RSS](/packages/shreifelagamy-laravel-service-modules/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (3)Dependencies (3)Versions (7)Used By (0)

Service Modules Generator for Laravel
=====================================

[](#service-modules-generator-for-laravel)

[![Laravel Service Modules](images/laravel-service-modules.png)](images/laravel-service-modules.png)

A Laravel package to easily generate service modules for your Laravel applications.

Understanding the Architecture
------------------------------

[](#understanding-the-architecture)

To gain a deeper understanding of the architecture and how to effectively use service modules in Laravel, you can read this Medium article:

[Simplify External API Integrations in Laravel Using Service Modules](https://medium.com/@theshreif/simplify-external-api-integrations-in-laravel-using-service-modules-56493a651a0e)

This article provides insights into the benefits and implementation details of using service modules for external API integrations in Laravel applications.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require shreifelagamy/laravel-service-modules
```

Usage
-----

[](#usage)

```
php artisan service:generate UserService
```

This will create a new service class in the `app/Services` directory.

During the generation process, you will be prompted to:

1. Generate an exception for the service
2. Add methods to the repository
3. Include Data Transfer Objects (DTOs) for the service

These prompts allow you to customize the service module according to your needs.

The generated service structure will look like this:

```
app/Services/UserService/
├── Providers/
│ └── UserServiceProvider.php
├── Repositories/
│ ├── UserServiceInterface.php
│ └── UserServiceRepository.php
├── Facades/
│ └── UserService.php
├── Exceptions/ (optional)
│ └── UserServiceException.php
└── DTOs/ (optional)
  └── UserData.php

```

Configuration
-------------

[](#configuration)

The package comes with a default configuration file that you can publish to customize the behavior:

```
php artisan vendor:publish --tag=laravel-service-modules-config
```

This will create a `config/laravel-service-modules.php` file where you can modify the default settings.

Customization
-------------

[](#customization)

You can control the directory name for generated services through the config file. This allows you to customize where your service modules are created within your Laravel application.

TODO
----

[](#todo)

We're constantly working to improve this package. Here are some features we're planning to add in the future:

1. Support auto-creating PHPDoc for facades to include method definitions.
2. Add more customization options for DTOs.

Stay tuned for these upcoming enhancements!

License
-------

[](#license)

The Laravel Services Generator is open-sourced software licensed under the MIT license.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance58

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~92 days

Total

5

Last Release

263d ago

Major Versions

v1.2.0 → v2.0.02025-02-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13520828?v=4)[Shreif Elagami](/maintainers/shreifelagamy)[@shreifelagamy](https://github.com/shreifelagamy)

---

Top Contributors

[![shreifelagamy](https://avatars.githubusercontent.com/u/13520828?v=4)](https://github.com/shreifelagamy "shreifelagamy (5 commits)")[![Abdulhakiem](https://avatars.githubusercontent.com/u/67789816?v=4)](https://github.com/Abdulhakiem "Abdulhakiem (1 commits)")[![wagner-sousa](https://avatars.githubusercontent.com/u/26163147?v=4)](https://github.com/wagner-sousa "wagner-sousa (1 commits)")

---

Tags

composerlaravellaravel-packagelaravel-service-modulesphp

### Embed Badge

![Health badge](/badges/shreifelagamy-laravel-service-modules/health.svg)

```
[![Health](https://phpackages.com/badges/shreifelagamy-laravel-service-modules/health.svg)](https://phpackages.com/packages/shreifelagamy-laravel-service-modules)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3991.8k](/packages/codewithdennis-larament)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
