定制 webkenth/directus-api-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webkenth/directus-api-laravel

最新稳定版本:v1.2

Composer 安装命令:

composer require webkenth/directus-api-laravel

包简介

Directus API Wrapper for Laravel 9, credit to C14r/directus-api-laravel

README 文档

README

packagist version directus version laravel version

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.

composer require c14r/directus-api-laravel

In Laravel 5, update the config/app.php providers array with the Service Provider:

C14r\Directus\Laravel\DirectusServiceProvider::class,

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 username
  • DIRECTUS_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:

php artisan vendor:publish --provider="C14r\Directus\Laravel\DirectusServiceProvider"

This will publish a config file to config/directus.php.

Usage

To utilize the API Wrapper, use dependency injection to resolve:

public function __construct(Directus $directus)
{
    $this->api = $directus;
}

or use the helper function:

directus() // or directus('connection')

How the API works

Take a look at c14r/directus-api for more details.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2022-08-02