zoukankan      html  css  js  c++  java
  • Dingo 的安装

    安装Dingo需要下面的环境:

    • Laravel 5.1 或 lumen 5.1 +
    • php 5.59+

    1. 修改composer.json 文件,添加下面的代码:

    "require": {
        "dingo/api": "1.0.*@dev"
    }

    2 .然后根目录下执行composer update

    3. Laravel的配置

    config/app.php中的providers数组中添加

    'providers' => [
        DingoApiProviderLaravelServiceProvider::class
    ]

    通常情况下,我们都会配置Dingo,我们可以生成自己我们可以修改的dingo配置文件,终端里执行下面的代码

    php artisan vendor:publish --provider="DingoApiProviderLaravelServiceProvider"

    4. 门面

    Dingo 中自带了两个门面,你可以根据自己的需要添加

    //This is a facade for the dispatcher, however, it also provides helper methods for other methods throughout the package.
    
    DingoApiFacadeAPI
    
    //This is a facade for the API router and can be used to fetch the current route, request, check the current route name, etc.
    
    DingoApiFacadeRoute

    为了方便,可以为上面的门面设置别名

    'aliases' => [
         'APIRoute'  => DingoApiFacadeRoute::class,
         'API'       => DingoApiFacadeAPI::class,
    ]
  • 相关阅读:
    expect简介和使用例子(转)
    openshift网络
    openstack相关
    SDN的开源方案sonic
    OpenStack Neutron ML2 Deep Dive
    2017双11技术揭秘—阿里数据库计算存储分离与离在线混布
    es的gui工具
    django orm中blank和null的区别
    断关联多表关系阐述
    视图使用
  • 原文地址:https://www.cnblogs.com/wxy0126/p/10738311.html
Copyright © 2011-2022 走看看