diff --git a/README.md b/README.md index 07eead8..aaa8294 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # CRUD GENERATOR - FOR SLIM 4 - API SKELETON -This package provide a command to generate RESTful endpoints, to manage any simple entity/table. +This package provide a command to generate a CRUD to manage any simple entity/table, in a RESTful API. -Given an resource, like a table in MySQL, autogenerate a simple CRUD endpoints. +Given an resource, like a table in MySQL, auto-generate a simple CRUD endpoints. For example, if you have a table with the name 'user', the script generate the new endpoints on routes `/user`. -Following the previous example, the command generate 5 (five) new endpoints like: +Following the previous example, the command generate 5 (five) new endpoints: -- Get All Users: `GET /user` -- Get One User: `GET /user/{id}` +- Get Users: `GET /user` - Create User: `POST /user` +- Get an User: `GET /user/{id}` - Update User: `PUT /user/{id}` - Delete User: `DELETE /user/{id}` -So, the script generate a real example with all files and directories: Controller, Services, Repository, etc, etc, that allow you to manage the new resource using as RESTful API. +So, the script generate a real example with all files and directories: Controller, Services, Repository, etc, etc, that allow you to manage the new resource using it like a RESTful API. Furthermore, the script make a file with PHPUnit tests, for each new endpoint generated. @@ -26,8 +26,8 @@ $ ./console api:generate:endpoints [table-name] OK - Generated endpoints for entity: [table-name] ``` -**This package is for exclusive use of this [Slim 4 - Api Skeleton](https://github.com/maurobonfietti/slim4-api-skeleton).** +**This package is for exclusive use of this [Slim 4 - Api Skeleton](https://github.com/maurobonfietti/slim4-api-skeleton) project.** *Work In Progress...* **Work In Progress...** -***Work In Progress :-)*** +***Work In Progress ;-)*** diff --git a/src/Command/CrudGeneratorCommand.php b/src/Command/CrudGeneratorCommand.php index 9aae30d..067a2a2 100644 --- a/src/Command/CrudGeneratorCommand.php +++ b/src/Command/CrudGeneratorCommand.php @@ -11,7 +11,7 @@ class CrudGeneratorCommand extends Command { - const COMMAND_VERSION = '0.7.0'; + const COMMAND_VERSION = '0.8.0'; public function __construct($app) { @@ -22,8 +22,8 @@ public function __construct($app) protected function configure() { $this->setName('api:generate:endpoints') - ->setDescription('Given an entity, autogenerate a simple CRUD/REST endpoints.') - ->setHelp('This command generate RESTful endpoints, to manage any entity. Version: ' . self::COMMAND_VERSION) + ->setDescription('Given an entity, auto-generate a simple CRUD endpoints.') + ->setHelp('This command generate a CRUD to manage any simple entity/table, in a RESTful API. Version: ' . self::COMMAND_VERSION) ->addArgument( 'entity', InputArgument::REQUIRED, @@ -35,8 +35,8 @@ protected function execute(InputInterface $input, OutputInterface $output) { $db = $this->container->get('db'); $entity = $input->getArgument('entity'); - $output->writeln('OK - Generated endpoints for entity: ' . $entity); $generator = new CrudGeneratorService(); $generator->generateCrud($db, $entity); + $output->writeln('OK - Generated endpoints for entity: ' . $entity); } }