PHP code example of wayhood / hyperf-action

1. Go to this page and download the library: Download wayhood/hyperf-action 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/ */

    

wayhood / hyperf-action example snippets


Router::addRoute(['GET', 'POST'], "/",
    'Wayhood\HyperfAction\Controller\MainController@index',
    ['middleware' => [\Wayhood\HyperfAction\Middleware\ActionMiddleware::class]]);

Router::get('/doc',
    'Wayhood\HyperfAction\Controller\MainController@doc');
shell
php bin/hyperf.php describe:actions  -d study.list
php bin/hyperf.php describe:actions
shell
php bin/hyperf.php gen:action --namespace 'App\Action\User' LoginAction
php bin/hyperf.php gen:service --namespace 'App\Service\Test' TestService