文档:https://github.com/dingo/api/wiki/Installation

1.安装

#PHP ^7.1 (However soon to be PHP 7.2)
composer require dingo/api
#LARAVEL 
php artisan vendor:publish --provider="Dingo\Api\Provider\LaravelServiceProvider"
#LUMEN
#in app/boostrap.php
$app->register(Dingo\Api\Provider\LumenServiceProvider::class);

2.版本控制

$api->version('v1', function ($api) {
$api->get('testa','\App\Http\Controllers\TestController@test_db');
});
##POSTMAN 请求时带版本号
##Header 里面 带入 [{"key":"Accept","value":"application/x.app_version.v1+json","description":""}]
api.config 里面配置:
API_SUBTYPE=app_version

php-rdkafka测试笔记

参考:https://learnku.com/articles/15176/laravel-implementation-of-kafka-message-push-and-receive-processing 安装 安装librdkafka 库 git clone https...

阅读全文

推荐一个好用的php日志类库,monolog/monolog

github仓库地址 官方文档: https://github.com/Seldaek/monolog/blob/main/doc/01-usage.md 安装 $ composer require monolog/monolog 使用方法 <?php us...

阅读全文

php 二维数组根据某个键值倒叙、升序排序

<?php $array = [ [ 'title' => '标题5', 'views' => 500 ], [ 'title&...

阅读全文

欢迎留言