Create a new project using composer. Add the following dependencies:
slim/slimslim/psr7
composer init{
"name": "sillevl/slim-database-example",
"description": "Slim 4 application that shows how to use a database with Eloquent",
"type": "project",
"require": {
"slim/slim": "4.x-dev",
"slim/psr7": "dev-master"
},
"license": "MIT",
"authors": [
{
"name": "Sille Van Landschoot",
"email": "info@sillevl.be"
}
],
"minimum-stability": "dev"
}Setup configuration in .env file.
Create the database
vendor\bin\phinx migrateAdd initial values to the database
vendor\bin\phinx seed:runReset the database
vendor\bin\phinx rollback