PHPackages                             gency/laravel-graphql-filter - 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. gency/laravel-graphql-filter

ActiveLibrary[API Development](/categories/api)

gency/laravel-graphql-filter
============================

Define GraphQL schema for connection filtering using Laravel filterable models

v1.0.4(9y ago)0437[1 issues](https://github.com/ttoohey/laravel-graphql-filter/issues)MITPHP

Since Jun 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ttoohey/laravel-graphql-filter)[ Packagist](https://packagist.org/packages/gency/laravel-graphql-filter)[ RSS](/packages/gency-laravel-graphql-filter/feed)WikiDiscussions master Synced 2w ago

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

Gency\\GraphQLFilter
====================

[](#gencygraphqlfilter)

Define GraphQL schema for connection filtering using Laravel filterable models.

Installation
============

[](#installation)

```
composer require gency/laravel-graphql-filter

```

Usage
=====

[](#usage)

Use Filterable trait on Model

```
namespace App;
use Gency\Filterable\Filterable;

class User extends Model
{
  use \Gency\Filterable\FilterableTrait;

  protected $filterable = [
    'name' => Filterable::String
  ];
}

```

Create GraphQL User type

```
namespace App\GraphQL\Type;

use App\User;
use GraphQL\Type\Definition\Type;
use Folklore\GraphQL\Support\Type as GraphQLType;

class User extends GraphQLType
{
  protected $attributes = [
    'name' => 'User'
  ];
  public function fields() {
    return [
      'id' => [
        'type' => Type::id(),
      ],
      'name' => [
        'type' => Type::string()
      ]
    ]
  }
}

```

Create GraphQL UserFilter type. The UserFilter fields defintion will be automatically populated with fields in `User::$filterable`.

```
namespace App\GraphQL\Type;

use App\User;
use Gency\GraphQLFilter\Type\FilterType;

class UserFilter extends FilterType
{
  protected $model = User::class;
}

```

Create GraphQL query type to list User records using the User model's filterable settings.

```
namespace App\GraphQL\Type;

use App\User;
use GraphQL;
use GraphQL\Type\Definition\Type;
use Folklore\GraphQL\Support\Query;

class UsersQuery extends Query
{
  protected $attributes = [
    'name' => 'users'
  ];
  public function type() {
    return Type::listOf(GraphQL::type('User'));
  }
  public function args() {
    return [
      'filter' => [
        'type' => GraphQL::type('UserFilter')
      ]
    ];
  }
  public function resolve($root, $args, $context) {
    return User::filter($args['filter'])->orderBy('name')->limit(10)->get();
  }
}

```

A GraphQL query can now use the `Filterable::String` rules to perform searches.

```
query ListJohns {
  users (filter: { name_MATCH: 'john' }) {
    name
  }
}

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

5

Last Release

3289d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/gency-laravel-graphql-filter/health.svg)

```
[![Health](https://phpackages.com/badges/gency-laravel-graphql-filter/health.svg)](https://phpackages.com/packages/gency-laravel-graphql-filter)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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