iamalexchip/clawcrane

一个用于从eloquent模型中像GraphQL一样进行过滤的laravel包

安装: 2

依赖: 0

建议者: 0

安全性: 0

星星: 1

关注者: 0

分支: 0

开放问题: 1

类型:package

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

This package is auto-updated.

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


README

Clawcrane是一个laravel包,用于在eloquent模型上像GraphQL一样进行数据获取。

使用示例

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"
    ]
]
*/