PHP code example of oooiik / laravel-export-postman

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

    

oooiik / laravel-export-postman example snippets


return [
    'name'        => env('APP_NAME', 'Laravel API'),
    'output_path' => storage_path('app/postman'),
    'base_url'    => env('APP_URL', 'http://localhost'),
    // ... and more
];

/**
 * @AuthBearer {{access_token}}
 */
public function show($id) { /* ... */ }

/**
 * @Header Accept => application/json
 * @Header X-Tenant-Id => {{tenant_id}}
 */
public function index() { /* ... */ }

/**
 * @DescriptionContext Returns a paginated list of orders for the authenticated user.
 * @DescriptionResourcePath docs/api/orders-index.md
 */
public function index() { /* ... */ }

/**
 * @PreRequestScriptFileResourcePath postman/scripts/refresh-token.js
 */
public function transfer() { /* ... */ }

/**
 * @TestScriptContext pm.test("Status 200", () => pm.response.to.have.status(200));
 */
public function login() { /* ... */ }

/**
 * @AuthBearer {{access_token}}
 * @Header Accept => application/json
 * @Header X-Tenant-Id => {{tenant_id}}
 * @DescriptionContext Creates a new order for the authenticated user.
 * @DescriptionResourcePath docs/api/orders-create.md
 * @PreRequestScriptFileResourcePath postman/scripts/sign-request.js
 * @TestScriptContext pm.test("Created", () => pm.response.to.have.status(201));
 */
public function store(StoreOrderRequest $request)
{
    // ...
}
bash
php artisan vendor:publish --provider="Oooiik\LaravelExportPostman\ExportPostmanServiceProvider"
bash
php artisan postman:export