PHP code example of tiacx / laravel-apifox

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

    

tiacx / laravel-apifox example snippets




namespace Tests\Feature;

use Tests\TestCase;

class ExampleTest extends TestCase
{
    /**
     * @test 测试生成ApiFox文档
     * @apifox.name 这是一个测试接口
     * @apifox.dirs Admin/Test
     * @apifox.tags test
     */
    public function test_laravel_apifox(): void
    {
        $response = $this->getJson('/api/admin/test')
            ->assertStatus(200)
            ->json();
        dd($response);
    }
}
bash
php artisan vendor:publish --tag=config