PHP code example of mk990 / mkapi

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

    

mk990 / mkapi example snippets


public function store(Request $request): JsonResponse
{
    $validated = $request->validate([
        'name' => '    Log::error($e->getMessage());
        return $this->error('create error');
    }
}
bash
php artisan install:mkapi --package
bash
php artisan mkapi:Model YOUR_MODEL_NAME
bash
php artisan mkapi:Model product
php artisan mkapi:Model all
bash
php artisan mkapi:Controller YOUR_CONTROLLER_NAME
bash
php artisan mkapi:Controller product
php artisan mkapi:Controller all
bash
php artisan mkapi:Model product --force
bash
php artisan mkapi:Controller product --code