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

ActiveLibrary[API Development](/categories/api)

simexis/laravel-graphql-filter
==============================

Define GraphQL schema for connection filtering using Laravel filterable models

020PHP

Since Apr 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jooorooo/laravel-graphql-filter)[ Packagist](https://packagist.org/packages/simexis/laravel-graphql-filter)[ RSS](/packages/simexis-laravel-graphql-filter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Simexis\\GraphQLFilter
======================

[](#simexisgraphqlfilter)

Define GraphQL schema for connection filtering using Laravel filterable models.

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

[](#installation)

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

```

Usage
=====

[](#usage)

Use Filterable trait on Model

```
namespace App;
use Simexis\Filterable\Filterable;

class User extends Model
{
  use \Simexis\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 Simexis\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

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

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.

### Community

Maintainers

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

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[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)

PHPackages © 2026

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