You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.0 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. # Pirectus - a small Client for Directus 9
  2. This Version is in a early Stage and only supports get, post, patch for Items. Authentification is only possible with token.
  3. ## Installation
  4. ```php
  5. composer require tentakelfabrik/pirectus
  6. ```
  7. ## Quickstart
  8. ```php
  9. require('vendor/autoload.php');
  10. use Pirectus\Pirectus;
  11. use Pirectus\Auth\TokenAuth;
  12. $pirectus = new Pirectus('<directus-url>', [
  13. 'auth' => new TokenAuth('<directus-authtoken>')
  14. ]);
  15. ```
  16. ```php
  17. $results = $pirectus
  18. ->items('pages')
  19. ->fields(['id', 'title', 'content'])
  20. ->filter([
  21. 'status' => ['_eq' => 'published']
  22. ])
  23. ->find();
  24. ```
  25. ## ItemsQueryBuilder
  26. ### fields(array $fields)
  27. ### addFields(array $fields)
  28. ### filter(array $filter)
  29. ### addFilter(array $filter)
  30. ### limit(int $value)
  31. ### offset(int $value)
  32. ### groupBy(array $groupBy)
  33. ### addGroupBy(string $field)
  34. ### aggregate(string $aggregate, string $field)
  35. ### sort(array $sort)
  36. ### addSort(array $sort)
  37. ### search(string $value)
  38. ### meta(string $value)
  39. ### aliases(string $field, string $alias)