Simple Package PHP for generate controllers, models and middlewares.
- PHP Version >= 8.2.0
Run the composer command for install this package.
composer require devvime/kiichi-php-generator
After, in composer.json insert this script.
"scripts":{
"new": "php -f vendor/devvime/Kiichi-php-generator/src/index.php"
}
Create the following directories in the project root:
├── src
| ├── Controllers
| |── Models
| |── Middlewares
To create a new controller with the assistant, just type the following command, informing the name of the controller and the name of the database table that will be used -> EX: composer new controller controllerName tableName.
composer new controller product products
Result:
├── src
| ├── Controllers
│ | └── ProductController.php
| |── Models
| | └── Products.php
To create a new middleware with the wizard, just type the following command informing the name of the middleware.
composer new middleware product
Result:
├── src
| ├── Middlewares
│ | └── ProductMiddleware.php
Type the following command.
composer new mail
Result:
├── src
| ├── Controllers
│ | └── EmailServiceController.php