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

ActiveLibrary[Framework](/categories/framework)

glesys/butler-service
=====================

Web service library based on Laravel

v0.30.0(6mo ago)523.8k↓15%1[1 PRs](https://github.com/glesys/butler-service/pulls)MITPHPPHP ^8.2CI passing

Since Apr 14Pushed 1w ago10 watchersCompare

[ Source](https://github.com/glesys/butler-service)[ Packagist](https://packagist.org/packages/glesys/butler-service)[ RSS](/packages/glesys-butler-service/feed)WikiDiscussions main Synced 3d ago

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

🚧 **Not ready for production.**

Butler Service
==============

[](#butler-service)

A Laravel-based micro-framework for web services using GraphQL.

Getting Started
---------------

[](#getting-started)

*Requires a working Laravel app with a database connection.*

```
composer require glesys/butler-service
```

Replace `Illuminate\Foundation\Application` with `Butler\Service\Foundation\Application` in `bootstrap/app.php`.

```
php artisan vendor:publish --tag=butler-config --tag=butler-assets
php artisan migrate
```

It is optional (but recommended) to extend your `TestCase` (or whatever file that extends Laravels `TestCase`) with `Butler\Service\Testing\TestCase`.

```
use Butler\Service\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    //
}
```

Service Providers
-----------------

[](#service-providers)

All service providers in your `app/Providers` directory will be registered automatically.

Config
------

[](#config)

You can use your configuration files as usual. See [src/config](src/config) for our defaults.

ℹ️ Remember that your applications `config/butler.php` only merges the first level of the [default configuration](src/config/butler.php).

Views
-----

[](#views)

Views can be updated by publishing them:

```
php artisan vendor:publish --tag=butler-views
```

### Extra

[](#extra)

If you dont want a `config/app.php` you can use `butler.service.extra` in `config/butler.php` to add "config". Note that "config" **will not** merge with existing config.

```
    // example
    'config' => [
        'foo' => 'bar',
        'trustedproxy.proxies' => [
            '10.0.0.0/8',
        ],
    ],
```

index.php
---------

[](#indexphp)

To keep your applications "index.php" up to date you can publish the one in butler-service.

ℹ️ Maintenance mode is not supported.

```
php artisan vendor:publish --force --tag=butler-index
```

Authentication with OAuth
-------------------------

[](#authentication-with-oauth)

Configure `butler.sso` in `config/butler.php`.

Set `butler.sso.fake` to `true` to fake to login process.

See [laravel/socialite](https://github.com/laravel/socialite) for more information.

Authentication with butler-auth
-------------------------------

[](#authentication-with-butler-auth)

```
$consumer = \Butler\Service\Models\Consumer::create(['name' => 'Service A']);

$token = $consumer->createToken(abilities: ['*'], name: 'token-name')->plainTextToken;
```

See [butler-auth](https://github.com/glesys/butler-auth) for more information.

### Authorization

[](#authorization)

GraphQL operations are authorized by the "graphql" `Gate` ability defined in the [ServiceProvider](src/ServiceProvider.php).

```
// allow "query" operations only
$consumer->createToken(['query'], 'my read-only token');

// allow "mutation" operations only
$consumer->createToken(['mutation'], 'my write-only token');

// allow specific operations
$consumer->createToken(['query:ping'], 'my "ping" token');
$consumer->createToken(['query', 'mutation:start'], 'my "start" token');

// allow any operations
$consumer->createToken(['*'], 'my full-access token');
$consumer->createToken(['query', 'mutation', 'subscription'], 'my graphql token');
```

GraphQL with butler-graphql
---------------------------

[](#graphql-with-butler-graphql)

See [butler-graphql](https://github.com/glesys/butler-graphql).

Audit with butler-audit
-----------------------

[](#audit-with-butler-audit)

See [butler-audit](https://github.com/glesys/butler-audit).

Health checks with butler-health
--------------------------------

[](#health-checks-with-butler-health)

See [butler-health](https://github.com/glesys/butler-health) for more information.

Testing
-------

[](#testing)

```
vendor/bin/phpunit
vendor/bin/pint --test
```

How To Contribute
-----------------

[](#how-to-contribute)

Development happens at GitHub; any typical workflow using Pull Requests are welcome. In the same spirit, we use the GitHub issue tracker for all reports (regardless of the nature of the report, feature request, bugs, etc.).

### Code standard

[](#code-standard)

As the library is intended for use in Laravel applications we encourage code standard to follow [upstream Laravel practices](https://laravel.com/docs/master/contributions#coding-style) - in short that would mean [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md).

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~124 days

Total

73

Last Release

198d ago

PHP version history (6 changes)v0.1.0PHP ^7.4

v0.3.5PHP ^7.4|^8.0

v0.10.0PHP ^8.0

v0.17.0PHP ^8.0.2

v0.22.0PHP ^8.1

v0.27.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/708205?v=4)[Christoffer Andersson](/maintainers/wecc)[@wecc](https://github.com/wecc)

---

Top Contributors

[![ttrig](https://avatars.githubusercontent.com/u/2156132?v=4)](https://github.com/ttrig "ttrig (264 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![wecc](https://avatars.githubusercontent.com/u/708205?v=4)](https://github.com/wecc "wecc (6 commits)")[![olvert](https://avatars.githubusercontent.com/u/5381285?v=4)](https://github.com/olvert "olvert (4 commits)")[![emil-nasso](https://avatars.githubusercontent.com/u/1119706?v=4)](https://github.com/emil-nasso "emil-nasso (1 commits)")

---

Tags

laravelmicroservice

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/glesys-butler-service/health.svg)

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

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

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[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)[ercogx/laravel-filament-starter-kit

This is a Filament v5 Starter Kit for Laravel 13, designed to accelerate the development of Filament-powered applications.

461.7k](/packages/ercogx-laravel-filament-starter-kit)

PHPackages © 2026

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