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(8y ago)0437[1 issues](https://github.com/ttoohey/laravel-graphql-filter/issues)MITPHP

Since Jun 19Pushed 8y 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 today

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 60% 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

3240d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d9f0858d13ea980b5ba03bcc6c769c6e6de784471225bd8007539f4462e86aa?d=identicon)[ttoohey](/maintainers/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

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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