Example of CLI crud, just for educational purposes!
- PHP +7.4
- Composer
- Generate autoload with composer:
$ composer install
- Copy
.env.example
to.env
:
$ cp .env.example .env
- Add your MySQL credentials in
.env
like:
# Database credentials
DATABASE_HOST=localhost
DATABASE_PORT=3306
DATABASE_NAME=std
DATABASE_USER=root
DATABASE_PASS=toor
Run the script with
$ php app.php
██████╗ ██╗ █████╗ ███████╗███████╗
██╔════╝██║ ██╔══██╗██╔════╝██╔════╝
██║ ██║ ███████║███████╗███████╗
██║ ██║ ██╔══██║╚════██║╚════██║
╚██████╗███████╗██║ ██║███████║███████║
╚═════╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝
[*] Author: Thiago thiiagoms
[*] Description: Little CLI crud
[*] Version: 1.0
=> For get help use: --help | -h
$ php app.php --help
- If you want help, run:
$ php app.php --help