PHP code example of qingbing / program-laravel-api

1. Go to this page and download the library: Download qingbing/program-laravel-api 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/ */

    

qingbing / program-laravel-api example snippets


# 添加所有路由
\Program\Assistant::initRoute();
# 添加指定模块路由
\Program\Assistant::initRoute(['login']);
# 添加自定义路由,一般为项目上新路由
\Program\Assistant::registerRoute(function(){
    Route::get('setting', ...);
});

// program 登录中间件
'programLogin' => \Program\Middleware\ProgramLogin::class,