PHPackages                             takeoo/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. takeoo/laravel-service-layer

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

takeoo/laravel-service-layer
============================

Lightweight service layer for laravel application!

v0.2.2(9y ago)153163[1 PRs](https://github.com/TakeoO/laravel-service-layer/pulls)PHPPHP &gt;=7.0.0

Since Mar 14Pushed 5y ago1 watchersCompare

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

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

Service Layer for laravel framework
===================================

[](#service-layer-for-laravel-framework)

Extra simple, lightweight service manager module for laravel app

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

[](#installation)

- Require repository

```
composer require takeoo/laravel-service-layer

```

- Add **\\Takeoo\\Service\\TakeooServiceServiceProvider::class** to *config/app.php* "providers" array
- Run:

```
  php artisan vendor:publish
```

Usage
-----

[](#usage)

- Create new service class (Example.php) anywhere in your project:

```
//Example.php

namespace  My\Service\Namespace;

use Takeoo\Service;

class MyService extends Service
{
// your code
}
```

or if you do not want to extend Service.php just use Service trait;

```
//Example.php

namespace  My\Service\Namespace;

use Takeoo\Service\Traits;

class MyService
{
 use Service;
// your code
}
```

- when you created new service class, you have to register it:
- go to config/service.php
- add your service to "services" array:

```
'services' => [
  'Example' => \My\Service\Namespace\Example::class,
]
```

- Add Service trait to your Controller.php class (if you extend it with all your controllers) or to every controller class in which you want to use Service layer

**By default all services are created as singletons, if you want to create non singleton class, provided its alias in "service.non-singleton" array**

Code
----

[](#code)

In code you can call your service as:

```
$service = $this->getService("Example");

```

if you want to use autocomplete (tested in JetBrains IDE) add PHPDoc above variable

```
/**
 * @var \My\Service\Namespace\Example $serivce
 */
$service = $this->getService("Example");

```

or you can always create helper functions for your commonly used services e.g:

```
/**
 * return \My\Service\Namespace\Example
 */
 public function getExampleService()
 {
  return $this->getService("Example");
 }
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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 ~2 days

Total

4

Last Release

3434d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8413270?v=4)[Jan Mrhar](/maintainers/TakeoO)[@TakeoO](https://github.com/TakeoO)

---

Top Contributors

[![TakeoO](https://avatars.githubusercontent.com/u/8413270?v=4)](https://github.com/TakeoO "TakeoO (2 commits)")

---

Tags

laravelservicelayer

### Embed Badge

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

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

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17930.8k](/packages/markwalet-nova-modal-response)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[ronasit/laravel-helpers

Provided helpers function and some helper class.

2087.0k31](/packages/ronasit-laravel-helpers)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1422.0k5](/packages/team-nifty-gmbh-tall-datatables)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

604.0k2](/packages/crumbls-layup)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.8k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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