aminkt / yii2-accounting-module
User accounting module for yii2
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
This package is auto-updated.
Last update: 2024-11-25 16:02:37 UTC
README
How to install this module:
Step1: First add flowing codes into project composer.json
"repositories": [
{
"type": "gitlab",
"url": "https://gitlab.com/aminkt/yii2-userAccounting-module"
}
],
Then add flowing line to require part of composer.json
:
"aminkt/yii2-userAccounting-module": "*",
And after that run bellow command in your composer :
Composer update aminkt/yii2-userAccounting-module
Step2: Add flowing lines in your application admin config in module part:
'userAccounting' => [
'class' => \aminkt\userAccounting\UserAccounting::className(),
'controllerNamespace' => \aminkt\userAccounting\UserAccounting::ADMIN_CONTROLLER_NAMESPACE,
'transactionModel' => '\your\transaction-model\class',
'userModel' => '\your\user-model\User',
],
Step3: Add flowing lines in your application frontend config in module part:
'userAccounting' => [
'class' => \aminkt\userAccounting\UserAccounting::className(),
'controllerNamespace' => \aminkt\userAccounting\UserAccounting::PANEL_CONTROLLER_NAMESPACE,
'transactionModel' => 'your\transaction-model\class',
'userModel' => '\your\user-model\User',
],
Step4: Implement aminkt\userAccounting\interfaces\TransactionInterface
into your transaction model.
Step5: Implement aminkt\userAccounting\interfaces\UserInterface
into your User model.
NOTE: Because every application need itself
User
model implementation so we don't create that in this module.But we created a common
Transaction
model. if you want use it just ignore step 4 and removetransactionModel
part in module config.
Database Migrations
Before usage this extension, we'll also need to prepare the database.
php yii migrate --migrationPath=@vendor/aminkt/yii2-userAccounting-module/migrations
NOTE: If you want use default
Transaction
table run below command to migrate it up.php yii migrate --migrationPath=@vendor/aminkt/yii2-userAccounting-module/migrations/manual-migrations