iamalexchip/clawcrane

A laravel package for using GraphQL like filtering from eloquent models

v1.0 2018-11-05 13:14 UTC

This package is auto-updated.

Last update: 2024-09-11 01:27:46 UTC


README

Clawcrane is a laravel package for GraphQl like data fetching on your eloquent models.

Usage example

use Iamalexchip\ClawCrane;

$users = User::get();
$clawcrane = new ClawCrane($users);
$template = '{"username": "", "firstname": "", "email": ""}';
$clawcrane->get($template);

/*
[
    "data" => [
        "users" => [
            [
                "username" => "zerochip",
                "firstname" => "Alex"
            ],
            [
                "username" => "johndoe",
                "firstname" => "John",
                "email" => "johndoe24@mail.com"
            ]
        ]
    ],
    "errors" => [
        "App\\User: attribute [email] access denied"
    ]
]
*/