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.
super-gear-directus/README.md

61 lines
1.4 KiB

3 years ago
# Super Gear Directus 1.0.0-rc2
5 years ago
Project to using a Directus Instance as CMS. Structure is inspired by Laravel, using [FlightPHP](https://github.com/mikecao/flight)
for handle Request.
5 years ago
## Installation
5 years ago
Download last Release, a Composer Installer will be Available in a Future Release.
5 years ago
## Snapshot
5 years ago
3 years ago
There is a Snapshot for a Basic Setup for the Directus Instance (snapshot.yaml)
5 years ago
## Quickstart
5 years ago
Create a **.env** from **.env.example** adding token and url for Directus Instance.
5 years ago
```
DIRECTUS_API_URL=
DIRECTUS_API_TOKEN=
5 years ago
```
3 years ago
## Laravel Mix
3 years ago
5 years ago
## Repositories
For getting Data use **App\\Respositories\\RepositoryAbstract** to create Repository-Classes.
This is the default class to handle
5 years ago
```PHP
5 years ago
class PageRepository extends RepositoryAbstract
{
/** endpoint */
protected $endpoint = 'pages';
5 years ago
/**
* find single page with a slug,
* page must be published
*
* @param string $slug
* @return array
*/
public function findOneBySlug($slug)
{
if (!$slug) {
$slug = [ '_null' => 'true' ];
}
5 years ago
return $this->queryBuilder
->fields(['title', 'slug', 'content', 'view', 'meta', 'media_teaser.*', 'media_hero.*'])
->aliases('view', 'template')
->filter([
'status' => 'published',
'slug' => $slug
])
->findOne();
5 years ago
}
}
5 years ago
```