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
.env
file, switch db connection, for exampleDB_CONNECTION=pgsql
- Create your database layer in
\src\Core\Database
for example,PostgreSql.php
,- extend base
Database
class 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.2
MySQL
|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 setup
Create a local database called order_ms
and import tables from /sql/tables/
To serve locally, simply run
php serve
or you can optionally run:
php -S localhost:<portnumber> -t public
To populate data:
php populate.php
To run the tests:
composer test