a-lawrence/laravel-wonde 问题修复 & 功能扩展

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

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

a-lawrence/laravel-wonde

Composer 安装命令:

composer require a-lawrence/laravel-wonde

包简介

This is a bridge package for the Wonde API Client.

README 文档

README

This is a simple bridge for the Wonde LTD API, using Graham Campbell's Laravel Manager package as a framework.

Installation

Add this package to your composer.json file:

composer require a-lawrence/laravel-wonde

Depending on your version of Laravel, it may be necessary to add your Service Provider to your config/app.php file:

  ...
  ALawrence\LaravelWonde\WondeServiceProvider::class,
  ...
  

Along with the Alias:

  ...
  'Wonde' => ALawrence\LaravelWonde\Facades\Wonde::class,
  ...
  

Config

Within your .env file (or environment variables) you can define the following two elements:

WONDE_TOKEN=Your-Access-Token
WONDE_SCHOOL=Specific-School

You will only need to set WONDE_SCHOOL if your application is a single school application.

If you'd like more control over the configuration, you could always publish the config file for this package and modify as necessary:

php artisan vendor:publish --provider="ALawrence\LaravelWonde\WondeServiceProvider"

Usage

Basic usage can be carried out by utilising dependency injection within your controller:

class DemoController extends Controller
{
    protected $wonde;

    public function __construct(WondeManager $wonde)
    {
        $this->wonde = $wonde;
    }

    public function display()
    {
        foreach ($this->wonde->schools->all() as $school) {
            // Display school name
            echo $school->name . PHP_EOL;
        }
    }
}

If you'd prefer to not use dependency injection, then that's fine too:

public function display()
    {
        foreach (Wonde::connection("main")->schools->all() as $school) {
            // Display school name
            echo $school->name . PHP_EOL;
        }
    }

For all other usage, non-specific to this bridge, view the Wonde API Client documentation: https://github.com/wondeltd/php-client

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固