Boilerplate to use a Directus Instance to Build a Custom Website, Content will be Manage by Directus
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.

60 lines
1.4 KiB

3 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
3 years ago
5 years ago
5 years ago
5 years ago
5 years ago
3 years ago
3 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # Super Gear Directus 1.0.0-rc2
  2. Project to using a Directus Instance as CMS. Structure is inspired by Laravel, using [FlightPHP](https://github.com/mikecao/flight)
  3. for handle Request.
  4. ## Installation
  5. Download last Release, a Composer Installer will be Available in a Future Release.
  6. ## Snapshot
  7. There is a Snapshot for a Basic Setup for the Directus Instance (snapshot.yaml)
  8. ## Quickstart
  9. Create a **.env** from **.env.example** adding token and url for Directus Instance.
  10. ```
  11. DIRECTUS_API_URL=
  12. DIRECTUS_API_TOKEN=
  13. ```
  14. ## Laravel Mix
  15. ## Repositories
  16. For getting Data use **App\\Respositories\\RepositoryAbstract** to create Repository-Classes.
  17. This is the default class to handle
  18. ```PHP
  19. class PageRepository extends RepositoryAbstract
  20. {
  21. /** endpoint */
  22. protected $endpoint = 'pages';
  23. /**
  24. * find single page with a slug,
  25. * page must be published
  26. *
  27. * @param string $slug
  28. * @return array
  29. */
  30. public function findOneBySlug($slug)
  31. {
  32. if (!$slug) {
  33. $slug = [ '_null' => 'true' ];
  34. }
  35. return $this->queryBuilder
  36. ->fields(['title', 'slug', 'content', 'view', 'meta', 'media_teaser.*', 'media_hero.*'])
  37. ->aliases('view', 'template')
  38. ->filter([
  39. 'status' => 'published',
  40. 'slug' => $slug
  41. ])
  42. ->findOne();
  43. }
  44. }
  45. ```