Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

[WIP] New implementations

WoLfulus edited this page Jan 3, 2020 · 3 revisions

NOTE: This is an active work in progress. The below are just random thoughts and experiments. It doesn't reflect the current codebase and/or installation steps.

Installing through composer

Install directus

  • Execute composer global require directus/installer

Create a directus application

  • Execute directus new api

Configure your directus application in config/directus/projects/default.php

(this basically does everything the laravel installation below does automatically)

Installing to laravel

Install laravel

  • Execute composer global require laravel/installer

Create a laravel application

  • Execute laravel new api

Install directus

  • Execute composer require directus/directus

Add directus provider in config/app.php

Directus\Api\Provider::class,

Add app provider if you wish to expose app in your application

Directus\App\Provider::class,

Usage

To create a new directus api, simply run

php artisan directus:create --project default

  • This will create a new default.php config file under config/directus/projects/ folder

To configure a directus api, edit the corresponding configuration file under config/directus/projects folder

To create a new directus api that uses use a custom config provider (for example environment variables), simply run

php artisan directus:create --project default --config env

--- if we keep using directus tables on the database ---

To install directus tables on a project's database, simply run

php artisan directus:install --project default

To upgrade your directus tables on a project's database, simply run

php artisan directus:upgrade --project default

To create a directus extensions, simply run

php artisan directus:extension create --name my_extension

To create custom routes, follow laravel instructions as this is just a laravel application enhanced with directus