PHP code example of zidbih / laravel-liveapi

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

    

zidbih / laravel-liveapi example snippets


// config/liveapi.php

'mask_fields' => [
    'password',
    'password_confirmation',
    'token',
    'card_number',
    'api_key',
    'secret',
],

Route::get('/api/users/profile', function (Request $request) {
    $data = [
        'id' => 1,
        'username' => 'zidbih',
    ];

    if ($request->has('extra')) {
        $data['bio'] = 'Software Engineer';
    }

    return response()->json($data);
});
bash
php artisan vendor:publish --tag=liveapi-config
bash
php artisan liveapi:generate
bash
php artisan vendor:publish --tag=liveapi-config
bash
php artisan liveapi:generate
bash
php artisan liveapi:status
bash
php artisan liveapi:clear
bash
php artisan liveapi:clear --spec