Download the PHP package webkenth/directus-api-laravel without Composer
On this page you can find all versions of the php package webkenth/directus-api-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webkenth/directus-api-laravel
More information about webkenth/directus-api-laravel
Files in webkenth/directus-api-laravel
Package directus-api-laravel
Short Description Directus API Wrapper for Laravel 9, credit to C14r/directus-api-laravel
License GPL-3.0-only
Informations about the package directus-api-laravel
Directus API Wrapper for Laravel 8
This package allows users to easily consume the REST API provided by the Directus Headless CMS system in any Laravel app.
If your looking for an API Wrapper without using Laravel, see c14r/directus-api.
Installing
The recommended way to install Directus-API is through Composer.
In Laravel 5, update the config/app.php
providers array with the Service Provider:
Configuration
By default, the package is set up to use the following configuration values from your .env
file:
DIRECTUS_URL
- The base URL of your Directus instance.DIRECTUS_PROJECT
- The Directus project, you want to use
Authentification
You can enter
DIRECTUS_API_KEY
- The key generated by Directus and associated with a user
or
DIRECTUS_USERNAME
- The Directus usernameDIRECTUS_PASSWORD
- The password for you Directus user
If you enter non of them, the guest access is used.
Laravel
If you would like to use a config file, you can publish the default config by running the following command:
This will publish a config file to config/directus.php
.
Usage
To utilize the API Wrapper, use dependency injection to resolve:
or use the helper function:
How the API works
Take a look at c14r/directus-api for more details.