PHPackages                             elfstack/slim-listing - 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. elfstack/slim-listing

AbandonedArchivedLibrary

elfstack/slim-listing
=====================

Quickly build listing API on Slim Framework

v1.1(6y ago)00MITPHPPHP ^7.2

Since Mar 4Pushed 6y ago2 watchersCompare

[ Source](https://github.com/elfstack/slim-listing)[ Packagist](https://packagist.org/packages/elfstack/slim-listing)[ RSS](/packages/elfstack-slim-listing/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Slim Listing
============

[](#slim-listing)

[![Latest Stable Version](https://camo.githubusercontent.com/5062e9f6136e50bc8d617b23e2d6517fd9418760ea606574d69e57de5973a84b/68747470733a2f2f706f7365722e707567782e6f72672f656c66737461636b2f736c696d2d6c697374696e672f762f737461626c65)](https://packagist.org/packages/elfstack/slim-listing)[![Total Downloads](https://camo.githubusercontent.com/148a3beeb441bc75d24c5a696ebd74b7e5b7c10de3e9c0ab70f7f8d2d3f413db/68747470733a2f2f706f7365722e707567782e6f72672f656c66737461636b2f736c696d2d6c697374696e672f646f776e6c6f616473)](https://packagist.org/packages/elfstack/slim-listing)[![Latest Unstable Version](https://camo.githubusercontent.com/827926b0ff134bf35b992260baac80208221a09f82dde91cc1f8d7211a6539f5/68747470733a2f2f706f7365722e707567782e6f72672f656c66737461636b2f736c696d2d6c697374696e672f762f756e737461626c65)](https://packagist.org/packages/elfstack/slim-listing)[![License](https://camo.githubusercontent.com/c88ac909a86812efffc7493ed626ebd3c8780a2eca1b61b61f2e38509897a23e/68747470733a2f2f706f7365722e707567782e6f72672f656c66737461636b2f736c696d2d6c697374696e672f6c6963656e7365)](https://packagist.org/packages/elfstack/slim-listing)

This package provides functionality to build a general listing API in a quick and convenient fashion. Which is heavily inspired by [BRACKETS-by-TRIAD/admin-listing](https://github.com/BRACKETS-by-TRIAD/admin-listing). It handles request like pagination, sorting, filtering and searching.

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

[](#installation)

### Composer

[](#composer)

```
composer require elfstack/slim-listing
```

### Slim (Recommended)

[](#slim-recommended)

```
$config = [
    'settings' => [
        'displayErrorDetails' => true,
        'db' => [
            'driver' => 'sqlite',
            'database' => __DIR__.'/../database.sqlite'
        ]
    ],
];

$app = new \Slim\App($config);

$container = $app->getContainer();

$capsule = new \Illuminate\Database\Capsule\Manager;
$capsule->addConnection($container['settings']['db']);
$capsule->bootEloquent();
$capsule->setAsGlobal();

$container['db'] = function ($container) use ($capsule){
    return $capsule;
};
```

Usage
-----

[](#usage)

### Full Example

[](#full-example)

```
function controllerMethod(Request $request, Response $response)
{
    return Listing::create(new Model())
                   ->attachSearching(['field1', 'field2'])
                   ->attachSorting(['field1', 'field2'])
                   ->attachFiltering(['field1', 'field2'])
                   ->modifyQuery(function ($query) {
                        $query->with('model2');
                   })
                   ->get($request, $response);
}
```

### Create an Instance

[](#create-an-instance)

```
Listing::create(Model::class);
Listing::create(new Model());
```

### Retrieving Result

[](#retrieving-result)

#### Get collection only

[](#get-collection-only)

```
get($request);
```

#### Get response

[](#get-response)

```
get($request, $response);
```

Query String Pattern
--------------------

[](#query-string-pattern)

Patterns below can be used together

- Ordering: `orderBy=&direction=`
- Filtering: `filter=`
- Pagination: `perPage=&page=`
- Search: `keyword=`

Response
--------

[](#response)

```
{
    "current_page":1,
    "data":[],
    "first_page_url":"/?page=1",
    "from":1,
    "last_page":1,
    "last_page_url":"/?page=1",
    "next_page_url":null,
    "path":"/",
    "per_page":10,
    "prev_page_url":null,
    "to":3,
    "total":3
}

```

**NOTE**: The url is not implemented and will remove in the future.

License
-------

[](#license)

MIT

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

Total

2

Last Release

2261d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17ed0f57a9be5d57ff04a5dd9409d0de182dc18a2efb2761bf6b737b6985a20a?d=identicon)[dodaydream](/maintainers/dodaydream)

---

Top Contributors

[![dodaydream](https://avatars.githubusercontent.com/u/20422615?v=4)](https://github.com/dodaydream "dodaydream (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elfstack-slim-listing/health.svg)

```
[![Health](https://phpackages.com/badges/elfstack-slim-listing/health.svg)](https://phpackages.com/packages/elfstack-slim-listing)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8703.0M17](/packages/yajra-laravel-oci8)[mehdi-fathi/eloquent-filter

Eloquent Filter adds custom filters automatically to your Eloquent Models in Laravel.It's easy to use and fully dynamic, just with sending the Query Strings to it.

450191.6k1](/packages/mehdi-fathi-eloquent-filter)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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