PHPackages                             zendaemon/service-layer - 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. zendaemon/service-layer

ActiveLibrary[Framework](/categories/framework)

zendaemon/service-layer
=======================

Service layer generator for laravel applications

2.0.0(5y ago)13.5k[1 issues](https://github.com/zendaemon/service-layer/issues)MITPHPPHP ^7.4CI failing

Since Jan 5Pushed 5y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (17)Used By (0)

Laravel Service layer
---------------------

[](#laravel-service-layer)

[![License](https://camo.githubusercontent.com/dea38551f836e436139b0483412e995e9cdcd86232fa1e490495f70ebc83a210/68747470733a2f2f706f7365722e707567782e6f72672f7a656e6461656d6f6e2f736572766963652d6c617965722f6c6963656e7365)](https://packagist.org/packages/zendaemon/service-layer)[![Build Status](https://camo.githubusercontent.com/b2d3f08197c54acb3865d981a5c57052a54f6ed408c97dc02604af8db938ebaa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a656e6461656d6f6e2f736572766963652d6c617965722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zendaemon/service-layer/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9b01a7efadc4013a0cdc1eca87d1b171c251094234a3039bbb848ac7d0cba75f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a656e6461656d6f6e2f736572766963652d6c617965722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zendaemon/service-layer/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/ac5801d4d4188ab11034145b8ab4dd0183fb1d8f5f73dc879bf8582b1d64972e/68747470733a2f2f706f7365722e707567782e6f72672f7a656e6461656d6f6e2f736572766963652d6c617965722f762f737461626c65)](https://packagist.org/packages/zendaemon/service-layer)[![Total Downloads](https://camo.githubusercontent.com/d27e252f36b5c64350621cb72b66d71aef451c5328ab430e967cd8c00c09ee36/68747470733a2f2f706f7365722e707567782e6f72672f7a656e6461656d6f6e2f736572766963652d6c617965722f646f776e6c6f616473)](https://packagist.org/packages/zendaemon/service-layer)[![StyleCI](https://camo.githubusercontent.com/03af5acf364a199fec61b2bb4bef161ba25734da3c194f62faced236f8421c2d/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3233313937353630372f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/231975607)

This Laravel package provides support for simple service layer. Service class the best place for your business logic.

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

[](#installation)

Require this package with composer.

```
composer require zendaemon/service-layer
```

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
Zendaemon\Services\ServiceLayerGeneratorServiceProvider::class,
```

After installing ServiceLayer, publish its assets using the services:install Artisan command:

php artisan services:install

Usage
-----

[](#usage)

### Simple service

[](#simple-service)

Using the make:service Artisan command, you can quickly create such a base service:

```
php artisan make:service SomeService
```

### Static service

[](#static-service)

Or you can create static service for simple tasks:

```
php artisan make:service SomeService --static
```

You can now add SomeService in your controller through DI:

```
final class SomeController extends Controller
{
    /** @var SomeService $service */
    private $service;

    public function __construct(SomeService $service)
    {
        $this->service = $service;
    }

    public function index(): ?ResourceCollection
    {
        return SomeCollection::collection($this->service->someListMethod());
    }

    public function store(StoreSomeRequest $request): ?JsonResource
    {
        return SomeResource::make($this->service->someCreationMethod($request));
    }

    public function update(UpdateSomeRequest $request, SomeModel $model): ?JsonResource
    {
        return SomeResource::make($this->service->someUpdatingMethod($request, $model));
    }

    public function destroy(SomeModel $model): JsonResponse
    {
        if (! $this->service->someDestroyMethod($model)) {
            return response()->json([
                'message' => 'Some error.',
            ], Response::HTTP_INTERNAL_SERVER_ERROR);
        }

        return response()->json(['success' => Response::HTTP_OK]);
    }
}
```

### Service class binding

[](#service-class-binding)

You can bind your services in Providers/ServiceLayerServiceProvider class like so.

```
namespace App\Providers;

use App\Services\LocationService;
use Illuminate\Support\ServiceProvider;

class ServiceLayerServiceProvider extends ServiceProvider
{
    /**
         * Register any application services.
         *
         * @return void
         */
        public function register()
        {
            $this->app->singleton(LocationService::class, function () {
                return new LocationService;
            });
        }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~28 days

Recently: every ~83 days

Total

16

Last Release

1910d ago

Major Versions

0.0.4 → 1.0.02020-01-06

1.1.6 → 2.0.02021-02-23

PHP version history (3 changes)0.0.1PHP &gt;=7.2

1.1.3PHP ^7.2.5

2.0.0PHP ^7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/abf2be8efdcca43e571459b4b9cd277e794a74130bb952437d2be3eacda2fb6f?d=identicon)[zendaemon](/maintainers/zendaemon)

---

Top Contributors

[![olenindenis](https://avatars.githubusercontent.com/u/11209688?v=4)](https://github.com/olenindenis "olenindenis (33 commits)")

---

Tags

laravelgeneratorserviceservice layerzenbusiness logicbusiness layerzendaemon

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zendaemon-service-layer/health.svg)

```
[![Health](https://phpackages.com/badges/zendaemon-service-layer/health.svg)](https://phpackages.com/packages/zendaemon-service-layer)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[internachi/modular

Modularize your Laravel apps

1.1k662.4k8](/packages/internachi-modular)

PHPackages © 2026

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