iamalexchip / clawcrane
一个用于从eloquent模型中像GraphQL一样进行过滤的laravel包
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" ] ] */