voicut31 / api_generator
API Generator
0.2.0
2021-06-29 12:57 UTC
Requires
- doctrine/orm: ^2.6
Requires (Dev)
- phpunit/phpunit: 8.*
This package is auto-updated.
Last update: 2024-09-29 05:42:32 UTC
README
It's generate api endpoints based on database tables
Install
Install composer
brew install composer
Install packages
composer install
Configure the aplication
Usage
...
use ApiGenerator\Generator;
$configuration = new \Doctrine\DBAL\Configuration();
$conn = \Doctrine\DBAL\DriverManager::getConnection($config['database'], $configuration);
...
$generator = new Generator($conn);
$generator->api($module, $id, $params);
Available request methods
'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'