PHP code example of five-say / laravel-api-tool

1. Go to this page and download the library: Download five-say/laravel-api-tool library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

five-say / laravel-api-tool example snippets




    'providers' => [
        ...
        FiveSay\Laravel\Api\ServiceProvider::class,
    ],



define('LARAVEL_START', microtime(true));

// 核心函数定义,最高优先级



    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,

    ];



    protected function mapWebRoutes(Router $router)
    {
        $router->group([
            // 'namespace' => $this->namespace, 'middleware' => 'web',
            'namespace' => $this->namespace, 'middleware' => 'api',
        ], function ($router) {
            

php artisan vendor:publish --provider="FiveSay\Laravel\Api\ServiceProvider"