PHP code example of phfoxer / apigenerate

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

    

phfoxer / apigenerate example snippets


// config/app.php
'providers' => [
    ...
    Phfoxer\ApiGenerate\ApiGenerateServiceProvider::class,
    ...
];

php artisan generate:api --con=conection_name

php artisan generate:api --table=table_name --relation=true

php artisan generate:api --table=table_name --route=my-custom-route --relation=true

php artisan generate:api --table=table_name --route=my-custom-route --relation=true