项目作者: iamalexchip

项目描述 :
A laravel single endpoint api package for querying eloquent models
高级语言: PHP
项目地址: git://github.com/iamalexchip/clawcrane.git
创建时间: 2018-10-26T15:02:05Z
项目社区:https://github.com/iamalexchip/clawcrane

开源协议:

下载


Clawcrane

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

Usage example

  1. use Iamalexchip\ClawCrane;
  2. $users = User::get();
  3. $clawcrane = new ClawCrane($users);
  4. $template = '{"username": "", "firstname": "", "email": ""}';
  5. $clawcrane->get($template);
  6. /*
  7. [
  8. "data" => [
  9. "users" => [
  10. [
  11. "username" => "zerochip",
  12. "firstname" => "Alex"
  13. ],
  14. [
  15. "username" => "johndoe",
  16. "firstname" => "John",
  17. "email" => "johndoe24@mail.com"
  18. ]
  19. ]
  20. ],
  21. "errors" => [
  22. "App\\User: attribute [email] access denied"
  23. ]
  24. ]
  25. */