PHPackages                             scrumptious/slagger - 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. [API Development](/categories/api)
4. /
5. scrumptious/slagger

ActiveLibrary[API Development](/categories/api)

scrumptious/slagger
===================

Slim middleware for generating Swagger json for use with Swagger UI

0.3.0(11y ago)101.2k4MITPHPPHP &gt;=5.4.0

Since Mar 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/schirinos/slagger)[ Packagist](https://packagist.org/packages/scrumptious/slagger)[ Docs](https://github.com/schirinos/slagger)[ RSS](/packages/scrumptious-slagger/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

Slagger
=======

[](#slagger)

A [Slim PHP](http://www.slimframework.com/) middleware for generating swagger json for use with Swagger UI. This middleware will automatically add swagger json endpoints for all your Swagger doc annotated classes. Uses [Zircote Swagger-php](https://github.com/zircote/swagger-php) to parse annotations.

Install Using Composer
----------------------

[](#install-using-composer)

```
{
    "require": {
        "scrumptious\slagger": "0.3.0"
    }
}

```

Usage
-----

[](#usage)

```
$app = new \Slim\Slim();

// Inject as Slim application middleware
$app->add(new \Slagger\Slagger('/api/v1/docs', __DIR__.'/../lib'));

\\ ... your app code

$app->run();
```

You'd then input the url **`http://yourapidomain.com/api/v1/docs`** in the Swagger-UI interface.

### Slagger(docsuri, scandir, options)

[](#slaggerdocsuri-scandir-options)

The constructor takes up to three arguments.

\####docsuri The uri in your app that will return swagger json.

\####scandir The directory to scan for files with Swagger annotations.

\####options \[optional\] Options passed through to the **getResource** function of the [Zircote swagger-php](https://github.com/zircote/Swagger-php) library.

### Annotations

[](#annotations)

The [Zircote Swagger-php](https://github.com/zircote/swagger-php) library will parse the Swagger annotations in your files. See the [Swagger-php docs](http://zircote.com/swagger-php/) for what annotations are supported.

ex:

```
/**
 * @SWG\Resource(
 *     apiVersion="0.1",
 *     swaggerVersion="1.2",
 *     resourcePath="/journey",
 *     basePath="http://myapi.com/api/v1"
 * )
 */
class Journey extends CRUD {
	// ...
}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

4297d ago

PHP version history (2 changes)v0.1PHP &gt;=5.3.0

0.3.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1234514?v=4)[schirinos](/maintainers/schirinos)[@schirinos](https://github.com/schirinos)

---

Top Contributors

[![schirinos](https://avatars.githubusercontent.com/u/1234514?v=4)](https://github.com/schirinos "schirinos (1 commits)")

---

Tags

jsonmiddlewaredocumentationswaggerslim

### Embed Badge

![Health badge](/badges/scrumptious-slagger/health.svg)

```
[![Health](https://phpackages.com/badges/scrumptious-slagger/health.svg)](https://phpackages.com/packages/scrumptious-slagger)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M129](/packages/darkaonline-l5-swagger)[darkaonline/swagger-lume

OpenApi or Swagger integration to Lumen

3362.4M3](/packages/darkaonline-swagger-lume)[jlapp/swaggervel

A great way to integrate Swagger into Laravel

490950.3k2](/packages/jlapp-swaggervel)

PHPackages © 2026

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