PHPackages                             arendach/request-datatable-criteria - 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. arendach/request-datatable-criteria

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

arendach/request-datatable-criteria
===================================

Package for integration with ares-datatable vue 3 component

v1.0.2(1y ago)028↓50%MITPHPPHP ^8.0

Since Feb 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Arendach/request-datatable-criteria)[ Packagist](https://packagist.org/packages/arendach/request-datatable-criteria)[ RSS](/packages/arendach-request-datatable-criteria/feed)WikiDiscussions master Synced 1mo ago

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

RequestDatatableCriteria
========================

[](#requestdatatablecriteria)

Description
-----------

[](#description)

`RequestDatatableCriteria` is an extension for the [prettus/l5-repository](https://github.com/andersao/l5-repository) package. It is designed to seamlessly integrate with the `ares-datatable` frontend component to handle server-side data filtering, sorting, searching, and pagination with minimal backend code. This package simplifies the interaction between the frontend and backend by adhering to a predefined request-response structure.

---

Features
--------

[](#features)

- **Filtering**: Automatically applies query-based filters (e.g., `?search=name:John`).
- **Sorting**: Supports ordering by specified fields (e.g., `?orderBy=name&sortedBy=asc`).
- **Pagination**: Handles paginated data with standard methods (e.g., `paginate()`).
- **Search Integration**: Includes support for partial matching using `like`.
- **Seamless Integration**: Works out-of-the-box with the `ares-datatable` frontend component.

---

Install
-------

[](#install)

To install the package, use Composer:

```
composer require arendach/request-datatable-criteria
```

---

Usage
-----

[](#usage)

### Adding Criteria to a Repository

[](#adding-criteria-to-a-repository)

In your repository's `boot` method, add the `RequestDatatableCriteria`:

```
use Arendach\RequestDatatableCriteria\RequestDatatableCriteria;

public function boot(): void
{
    $this->pushCriteria(app(RequestDatatableCriteria::class));
}
```

### Controller Example

[](#controller-example)

Here's an example of integrating the package with a controller:

```
use Illuminate\Http\Request;
use App\Repositories\Repository;
use Arendach\RequestDatatableCriteria\RequestDatatableCriteria;

class CustomerController extends Controller
{
    protected $repository;

    public function __construct(Repository $repository)
    {
        $this->repository = $repository;
        $this->repository->pushCriteria(app(RequestDatatableCriteria::class));
    }

    public function index(Request $request)
    {
        $customers = $this->repository->paginate();
        return response()->json($customers);
    }
}
```

---

Configuration
-------------

[](#configuration)

The package requires no additional configuration. It works directly with Laravel's request object and `prettus/l5-repository`. However, you can extend or customize it based on your application's requirements.

---

Example Request
---------------

[](#example-request)

### Query Parameters

[](#query-parameters)

- **Filtering**:

    ```
    GET /customers?search=name:John

    ```

    Filters customers where the `name` contains "John".
- **Sorting**:

    ```
    GET /customers?orderBy=created_at&sortedBy=desc

    ```

    Retrieves customers sorted by the `created_at` field in descending order.
- **Pagination**:

    ```
    GET /customers?limit=10

    ```

    Returns 10 customers per page.

---

Author
------

[](#author)

> **Arendach Taras**
>

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance45

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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

Total

3

Last Release

427d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2d890306073bb761361bfef9072234c0701a91637537c8b819cbfeb85f42f50?d=identicon)[arendach](/maintainers/arendach)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arendach-request-datatable-criteria/health.svg)

```
[![Health](https://phpackages.com/badges/arendach-request-datatable-criteria/health.svg)](https://phpackages.com/packages/arendach-request-datatable-criteria)
```

PHPackages © 2026

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