Simple order management system with PHP utilizing MVC pattern and database layer as MySQL.
If you are not using MySQL, you can optionally switch another database layer by following the steps,
- In
.envfile, switch db connection, for exampleDB_CONNECTION=pgsql- Create your database layer in
\src\Core\Databasefor example,PostgreSql.php,- extend base
Databaseclass and you may want to overwrite theconnect()method- then implement
App\Contracts\DataOperationsInterface- register entry in
/src/bootstrap.php
$app->bind(Database::class, function() {
return match($_ENV['DB_CONNTECTION']) {
'mysql' => new MySQL(),
'pgsql' => new PostgreSql()
};php >= 8.2MySQL|MariaDB
clone this repo with:
git clone "https://github.com/kgsint/oms-php.git"And then, to setup .env file and install required dependencies, run:
composer setupCreate a local database called order_ms and import tables from /sql/tables/
To serve locally, simply run
php serveor you can optionally run:
php -S localhost:<portnumber> -t publicTo populate data:
php populate.phpTo run the tests:
composer test