five-say/laravel-api-tool
laravel-api-tool
自用 laravel api 辅助工具库
从 composer 安装
// 安装
composer require five-say/laravel-api-tool -vv
// 更新
composer update five-say/laravel-api-tool -vv
在 /api/config/app.php 中注册服务提供者
<?php
'providers' => [
...
FiveSay\Laravel\Api\ServiceProvider::class,
],
执行 artisan 命令,发布扩展文件
php artisan vendor:publish --provider="FiveSay\Laravel\Api\ServiceProvider"
在 /api/bootstrap/autoload.php 中引入核心函数库
<?php
define('LARAVEL_START', microtime(true));
// 核心函数定义,最高优先级
require __DIR__.'/../ext/changeCoreHelpers.php';
在 /api/app/Http/Kernel.php 中添加路由中间件
<?php
protected $routeMiddleware = [
...
'module' => \FiveSay\Laravel\Api\Middleware\ModuleMiddleware::class,
'jwt.auth' => \FiveSay\Laravel\Api\Middleware\JwtAuthMiddleware::class,
'jwt.both' => \FiveSay\Laravel\Api\Middleware\JwtBothMiddleware::class,
'api.auth' => \Ext\Middleware\ApiAuthMiddleware::class,
];
修改 /api/app/Providers/RouteServiceProvider.php 中的全局路由中间件设置
<?php
protected function mapWebRoutes(Router $router)
{
$router->group([
// 'namespace' => $this->namespace, 'middleware' => 'web',
'namespace' => $this->namespace, 'middleware' => 'api',
], function ($router) {
require app_path('Http/routes.php');
});
}
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
641,106,524
9,700
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
418,291,778
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
394,964,158
4,660
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| 0.5.3 | 5.1.*| | ||
| 0.5.2 | 5.1.*| | ||
| 0.5.1 | 5.1.*| | ||
| 0.5.0 | 5.1.*| | ||
| 0.4.2 | 5.1.*| | ||
| 0.4.1 | 5.1.*| | ||
| 0.4.0 | 5.1.*| | ||
| 0.3.0 | 5.1.*| | ||
| 0.2.3 | 5.1.*| | ||
| 0.2.2 | 5.1.*| | ||
| 0.2.1 | 5.1.*| | ||
| 0.2.0 | 5.1.*| | ||
| 0.1.4 | 5.1.*| | ||
| 0.1.3 | 5.1.*| | ||
| 0.1.2 | 5.1.*| | ||
| 0.1.1 | 5.1.*| | ||
| 0.1.0 | 5.1.*| |