承接 vcarreira/wordsapi-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

vcarreira/wordsapi-laravel

Composer 安装命令:

composer require vcarreira/wordsapi-laravel

包简介

A simple WordsAPI service provider for Laravel 5

README 文档

README

A simple Laravel 5 service provider for the WordsApi service.

Installation

Add the following line to the require section of composer.json:

{
    "require": {
        "vcarreira/wordsapi-laravel": "~1.0"
    }
}

Setup

In /config/app.php, add the following to providers:

WordsApi\WordsApiServiceProvider::class,

and the following to aliases:

'WordsApi' => WordsApi\Facades\WordsApi::class,

Configuration

In order to use the service you must first get an API key from WordsAPI. By default, the package uses the following environment variables to auto-configure the service without modification:

WORDSAPI_API_KEY

To customize the configuration file, publish the package configuration using Artisan.

php artisan vendor:publish --provider="WordsApi\WordsApiServiceProvider"

Update your settings in the generated app/config/wordsapi.php configuration file.

Usage

To use the service within your app, you need to retrieve it from the Laravel IoC Container. The following example uses the app helper to retrieve information about the word 'effect'.

    $word = app('wordsapi')->word('effect');
    var_dump($word->definitions());
    var_dump($word->synonyms());
    var_dump($word->rhymes());
    var_dump($word->pronunciation());

If the facade is registered within the aliases section of the application configuration, you can also use the following code:

    $word = WordsApi::word('effect');
    var_dump($word->definitions());
    var_dump($word->synonyms());
    var_dump($word->rhymes());
    var_dump($word->pronunciation());

Limitation

Version 1.0 does not support search requests.

Links

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固