creso/laravel-easyoffice-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

creso/laravel-easyoffice-api

最新稳定版本:0.0.2

Composer 安装命令:

composer require creso/laravel-easyoffice-api

包简介

Laravel EasyOffice API wrapper

README 文档

README

Latest Version on Packagist Total Downloads

Laravel wrapper around the EasyOffice API.

Installation

You can install the package via composer:

composer require creso/laravel-easyoffice-api

You can publish the config file with:

php artisan vendor:publish --tag="easyoffice-api-config"

This is the contents of the published config file:

return [

    /**
     * The base url of the EasyOffice API.
     */
    'base_url' => env('EASY_OFFICE_API_BASE_URL'),

    /**
     * The API token to authenticate with the EasyOffice API.
     */
    'api_token' => env('EASY_OFFICE_API_TOKENS'),

    /**
     * Enable or disable api response cache. (not used yet)
     */
    'enable_cache' => env('EASY_OFFICE_ENABLE_CACHE'),
    
    /**
     * The cache lifetime of an api response in seconds. (not used yet)
     *
     * This will only be used in case no specific cache lifetime is configured for the api type
     * in the config setting below.
     */
    'default_cache_liftime' => 60 * 60,  // 1h

    /**
     * The cache lifetime of an api response in seconds for a given api type. (not used yet)
     */
    'cache_lifetime' => [
        'webcontentParts' => 60 * 60 * 24, // 24h
    ],
];

Usage

Facade vs Dependency injection vs app helper

# Using the facade
EasyOfficeApi::webcontentParts()->all();
# Dependency injection

use Creso\LaravelEasyofficeApi\EasyofficeApi;

class MyClass 
{
    public function __construct(private EasyofficeApi $easyofficeApi)
    {
    }
    
    public function __invoke()
    {
        $this->easyofficeApi->webcontentParts()->all();    
    }    
}
# Using the Laravel app helper
use Creso\LaravelEasyofficeApi\EasyofficeApi;

app(EasyofficeApi::class)->webcontentParts()->all();

Webcontent parts

# Get all webcontent parts
EasyOfficeApi::webcontentParts()->all();

# Get all webcontents parts, but filterd by uuid
EasyOfficeApi::webcontentParts()->all(['uuid' => 'a-full-or-partial-uuid-to-filter-on']);

# A specific webcontent part by uuid
EasyOfficeApi::webcontentParts()->get('729bc31d-ab1b-4cfb-9dab-b5419bdc92ca');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-26