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)153083[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 2mo 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

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

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

3341d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a21a1379906ea6f0ec0688e018964544b990f27a896397db91a9fef5d18d5be0?d=identicon)[TakeoO](/maintainers/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

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[tomshaw/electricgrid

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

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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