large commit

This commit is contained in:
omair saleh
2021-03-11 13:06:02 +08:00
parent 13ddf458db
commit 05401f6bbc
729 changed files with 23312 additions and 7218 deletions
@@ -1,5 +1,6 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
@@ -10,6 +11,7 @@ class CreatePermissionTables extends Migration
* Run the migrations.
*
* @return void
* @throws Exception
*/
public function up()
{
@@ -36,10 +38,10 @@ class CreatePermissionTables extends Migration
});
Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) {
$table->unsignedBigInteger('permission_id');
$table->foreignId('permission_id');
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->foreignId($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
$table->foreign('permission_id')
@@ -52,10 +54,10 @@ class CreatePermissionTables extends Migration
});
Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) {
$table->unsignedBigInteger('role_id');
$table->foreignId('role_id');
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->foreignId($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
$table->foreign('role_id')
@@ -68,8 +70,8 @@ class CreatePermissionTables extends Migration
});
Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
$table->unsignedBigInteger('permission_id');
$table->unsignedBigInteger('role_id');
$table->foreignId('permission_id');
$table->foreignId('role_id');
$table->foreign('permission_id')
->references('id')
@@ -93,6 +95,7 @@ class CreatePermissionTables extends Migration
* Reverse the migrations.
*
* @return void
* @throws Exception
*/
public function down()
{
@@ -1,6 +1,7 @@
<?php
use App\Classes\ValueObjects\Constants\Roles;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\RoleTypes;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -19,12 +20,12 @@ class CreateUsersTable extends Migration
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->integer('type')->nullable()->default(1);
$table->integer('status')->nullable()->default(1);
$table->integer('type')->default(RoleTypes::USER);
$table->integer('status')->default(ApprovalStatus::PENDING_VERIFICATION);
$table->rememberToken();
$table->timestamp('active_at')->nullable();
$table->timestamps();
$table->softDeletes();
$table->timestamps();
});
}
@@ -15,11 +15,11 @@ class CreateCountriesTable extends Migration
{
Schema::create('countries', function (Blueprint $table) {
$table->id();
$table->string('name')->nullable();
$table->string('short_code')->nullable();
$table->string('phone_code')->nullable();
$table->timestamps();
$table->string('name')->unique();
$table->string('short_code')->unique();
$table->string('phone_code')->unique();
$table->softDeletes();
$table->timestamps();
});
}
@@ -15,13 +15,14 @@ class CreateCurrenciesTable extends Migration
{
Schema::create('currencies', function (Blueprint $table) {
$table->id();
$table->bigInteger('country_id')->unsigned()->nullable();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
$table->string('name')->nullable();
$table->string('short_code')->nullable();
$table->foreignId('country_id')->unsigned();
$table->string('name');
$table->string('short_code');
$table->string('symbol')->nullable();
$table->timestamps();
$table->softDeletes();
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries');
});
}
@@ -15,12 +15,13 @@ class CreateCurrencyLogsTable extends Migration
{
Schema::create('currency_logs', function (Blueprint $table) {
$table->id();
$table->bigInteger('currency_id')->unsigned()->nullable();
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->decimal('selling', 20, 5)->nullable();
$table->bigInteger('created_by')->unsigned()->nullable();
$table->foreign('created_by')->references('id')->on('users')->onDelete('cascade');
$table->foreignId('currency_id')->unsigned();
$table->foreignId('created_by')->unsigned();
$table->softDeletes();
$table->timestamps();
$table->foreign('created_by')->references('id')->on('users');
$table->foreign('currency_id')->references('id')->on('currencies');
});
}
@@ -1,5 +1,6 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -15,12 +16,13 @@ class CreateStatesTable extends Migration
{
Schema::create('states', function (Blueprint $table) {
$table->id();
$table->bigInteger('country_id')->unsigned()->nullable();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
$table->string('name')->nullable();
$table->integer('status')->nullable();
$table->timestamps();
$table->foreignId('country_id')->unsigned();
$table->string('name');
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->softDeletes();
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries');
});
}
@@ -1,5 +1,6 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -15,15 +16,16 @@ class CreateDistrictsTable extends Migration
{
Schema::create('districts', function (Blueprint $table) {
$table->id();
$table->bigInteger('country_id')->unsigned()->nullable();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
$table->bigInteger('state_id')->unsigned()->nullable();
$table->foreign('state_id')->references('id')->on('states')->onDelete('cascade');
$table->string('name')->nullable();
$table->text('postcode')->nullable();
$table->integer('status')->nullable();
$table->timestamps();
$table->foreignId('country_id')->unsigned();
$table->foreignId('state_id')->unsigned();
$table->string('name');
$table->text('postcode');
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->softDeletes();
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries');
$table->foreign('state_id')->references('id')->on('states');
});
}
@@ -15,7 +15,7 @@ class CreatePasswordResetsTable extends Migration
{
Schema::create('password_resets', function (Blueprint $table) {
$table->id();
$table->bigInteger('user_id')->unsigned();
$table->foreignId('user_id')->unsigned();
$table->string('token');
$table->boolean('is_expired')->default(true);
$table->boolean('is_complete')->default(false);
@@ -17,9 +17,9 @@ class CreateActivityLogTable extends Migration
$table->id();
$table->string('log_name')->nullable();
$table->text('description');
$table->unsignedBigInteger('subject_id')->nullable();
$table->foreignId('subject_id')->nullable();
$table->string('subject_type')->nullable();
$table->unsignedBigInteger('causer_id')->nullable();
$table->foreignId('causer_id')->nullable();
$table->string('causer_type')->nullable();
$table->text('properties')->nullable();
$table->timestamps();
@@ -1,6 +1,7 @@
<?php
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\CompanyType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -19,11 +20,11 @@ class CreateCompaniesTable extends Migration
$table->id();
$table->string('name');
$table->string('reference');
$table->integer('type');
$table->integer('type')->default(CompanyType::COMPANY_BUSINESS);
$table->integer('business_type')->default(BusinessType::IMPORTER);
$table->integer('status')->default(ApprovalStatus::ACTIVE);
$table->timestamps();
$table->integer('status')->default(ApprovalStatus::PENDING_SUBMISSION);
$table->softDeletes();
$table->timestamps();
});
}
@@ -15,15 +15,17 @@ class CreateContactsTable extends Migration
{
Schema::create('contacts', function (Blueprint $table) {
$table->id();
$table->bigInteger('country_id')->unsigned()->nullable();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
$table->bigInteger('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->string('reference')->nullable();
$table->foreignId('company_id')->unsigned();
$table->foreignId('country_id')->unsigned();
$table->string('reference');
$table->string('phone')->nullable();
$table->string('email')->nullable();
$table->string('wechat_id')->nullable();
$table->softDeletes();
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries');
$table->foreign('company_id')->references('id')->on('companies');
});
}
@@ -16,20 +16,21 @@ class CreateAddressesTable extends Migration
{
Schema::create('addresses', function (Blueprint $table) {
$table->id();
$table->bigInteger('country_id')->unsigned()->nullable();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
$table->bigInteger('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->bigInteger('state_id')->unsigned()->nullable();
$table->foreign('state_id')->references('id')->on('states')->onDelete('cascade');
$table->bigInteger('district_id')->unsigned()->nullable();
$table->foreign('district_id')->references('id')->on('districts')->onDelete('cascade');
$table->string('postcode')->nullable();
$table->string('street_one')->nullable();
$table->foreignId('company_id')->unsigned();
$table->foreignId('country_id')->unsigned();
$table->foreignId('state_id')->unsigned();
$table->foreignId('district_id')->unsigned();
$table->string('postcode');
$table->string('street_one');
$table->string('street_two')->nullable();
$table->integer('billing_type')->nullable();
$table->timestamps();
$table->integer('billing')->default(true);
$table->softDeletes();
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries');
$table->foreign('company_id')->references('id')->on('companies');
$table->foreign('state_id')->references('id')->on('states');
$table->foreign('district_id')->references('id')->on('districts');
});
}
@@ -1,10 +1,11 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCompanyEmployeesTable extends Migration
class CreateEmployeesTable extends Migration
{
/**
* Run the migrations.
@@ -13,12 +14,14 @@ class CreateCompanyEmployeesTable extends Migration
*/
public function up()
{
Schema::create('company_employee', function (Blueprint $table) {
$table->bigInteger('company_id')->unsigned();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->bigInteger('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
Schema::create('employees', function (Blueprint $table) {
$table->foreignId('company_id')->unsigned();
$table->foreignId('user_id')->unsigned();
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->primary(['company_id', 'user_id']);
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('company_id')->references('id')->on('companies');
});
}
@@ -1,5 +1,6 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -15,18 +16,18 @@ class CreateDocumentsTable extends Migration
{
Schema::create('documents', function (Blueprint $table) {
$table->id();
$table->integer('owner_id')->nullable();
$table->integer('owner_type')->nullable();
$table->string('document_type')->nullable();
$table->string('reference')->nullable();
$table->integer('status')->nullable();
$table->bigInteger('approved_by')->unsigned()->nullable();
$table->foreign('approved_by')->references('id')->on('users')->onDelete('cascade');
$table->morphs('owner');
$table->string('document_type');
$table->string('reference');
$table->integer('status')->default(ApprovalStatus::PENDING_VERIFICATION);
$table->timestamp('issued_date')->nullable();
$table->timestamp('expired_date')->nullable();
$table->timestamp('approved_date')->nullable();
$table->timestamps();
$table->foreignId('approver')->nullable()->unsigned();
$table->timestamp('approval_date')->nullable();
$table->softDeletes();
$table->timestamps();
$table->foreign('approver')->references('id')->on('users');
});
}
@@ -1,5 +1,6 @@
<?php
use App\Classes\ValueObjects\Constants\FileType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -15,12 +16,13 @@ class CreateFilesTable extends Migration
{
Schema::create('files', function (Blueprint $table) {
$table->id();
$table->bigInteger('document_id')->unsigned();
$table->foreign('document_id')->references('id')->on('documents')->onDelete('cascade');
$table->text('file')->nullable();
$table->string('file_type')->nullable();
$table->timestamps();
$table->foreignId('document_id')->unsigned();
$table->text('file');
$table->string('file_type')->default(FileType::JPEG);
$table->softDeletes();
$table->timestamps();
$table->foreign('document_id')->references('id')->on('documents');
});
}
@@ -1,5 +1,7 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -15,9 +17,11 @@ class CreateSegmentsTable extends Migration
{
Schema::create('segments', function (Blueprint $table) {
$table->id();
$table->string('name')->nullable();
$table->timestamps();
$table->string('name');
$table->integer('type')->default(SegmentConstants::STANDARD_SEGMENT);
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->softDeletes();
$table->timestamps();
});
}
@@ -15,14 +15,14 @@ class CreateSegmentConstantsTable extends Migration
{
Schema::create('segment_constants', function (Blueprint $table) {
$table->id();
$table->bigInteger('segment_id')->unsigned()->nullable();
$table->foreign('segment_id')->references('id')->on('segments')->onDelete('cascade');
$table->string('name')->nullable();
$table->string('reference')->nullable();
$table->text('detail')->nullable();
$table->timestamps();
$table->integer('type')->nullable();
$table->foreignId('segment_id')->unsigned();
$table->string('name');
$table->string('reference');
$table->json('detail');
$table->softDeletes();
$table->timestamps();
$table->foreign('segment_id')->references('id')->on('segments');
});
}
@@ -13,12 +13,15 @@ class CreateSegmentCompaniesTable extends Migration
*/
public function up()
{
Schema::create('segment_company', function (Blueprint $table) {
$table->bigInteger('segment_id')->unsigned();
$table->foreign('segment_id')->references('id')->on('segments')->onDelete('cascade');
$table->bigInteger('company_id')->unsigned();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
Schema::create('segment_companies', function (Blueprint $table) {
$table->foreignId('segment_id')->unsigned();
$table->foreignId('company_id')->unsigned();
$table->softDeletes();
$table->timestamps();
$table->primary(['segment_id', 'company_id']);
$table->foreign('segment_id')->references('id')->on('segments');
$table->foreign('company_id')->references('id')->on('companies');
});
}
@@ -1,10 +1,12 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BankAccountType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCompanyBanksTable extends Migration
class CreateBanksTable extends Migration
{
/**
* Run the migrations.
@@ -13,20 +15,22 @@ class CreateCompanyBanksTable extends Migration
*/
public function up()
{
Schema::create('company_banks', function (Blueprint $table) {
Schema::create('banks', function (Blueprint $table) {
$table->id();
$table->bigInteger('country_id')->unsigned()->nullable();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
$table->bigInteger('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->foreignId('company_id')->unsigned();
$table->string('reference')->nullable();
$table->string('bank_name');
$table->string('holder_name');
$table->string('account_no');
$table->integer('type');
$table->integer('default');
$table->integer('status')->default(1);
$table->timestamps();
$table->integer('type')->default(BankAccountType::EXTERNAL);
$table->integer('default')->default(false);
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->foreignId('country_id')->unsigned();
$table->softDeletes();
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries');
$table->foreign('company_id')->references('id')->on('companies');
});
}
@@ -0,0 +1,36 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateServiceTypesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('service_types', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('status')->default(ApprovalStatus::APPROVED);
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('service_types');
}
}
@@ -1,5 +1,6 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -15,22 +16,24 @@ class CreateBookingsTable extends Migration
{
Schema::create('bookings', function (Blueprint $table) {
$table->id();
$table->bigInteger('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->bigInteger('transferable_bank_id')->unsigned()->nullable();
$table->foreign('transferable_bank_id')->references('id')->on('company_banks')->onDelete('cascade');
$table->string('marking');
$table->string('reference');
$table->float('fix_amount', 20, 5)->nullable();
$table->bigInteger('fix_currency_id')->unsigned()->nullable();
$table->foreign('fix_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->bigInteger('convertible_currency_id')->unsigned()->nullable();
$table->foreign('convertible_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->bigInteger('conversion_currency_id')->unsigned()->nullable();
$table->foreign('conversion_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->integer('status')->default(1);
$table->timestamps();
$table->foreignId('company_id')->unsigned();
$table->string('marking')->unique();
$table->foreignId('service_id')->unsigned();
$table->foreignId('bank_id')->unsigned();
$table->float('fix_amount', 20, 5);
$table->foreignId('fix_currency_id')->unsigned();
$table->foreignId('convertible_currency_id')->unsigned();
$table->foreignId('conversion_currency_id')->unsigned();
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->softDeletes();
$table->timestamps();
$table->foreign('company_id')->references('id')->on('companies');
$table->foreign('service_id')->references('id')->on('service_types');
$table->foreign('bank_id')->references('id')->on('banks');
$table->foreign('fix_currency_id')->references('id')->on('currencies');
$table->foreign('convertible_currency_id')->references('id')->on('currencies');
$table->foreign('conversion_currency_id')->references('id')->on('currencies');
});
}
@@ -16,14 +16,15 @@ class CreateCompaniesWalletTable extends Migration
Schema::create('wallets', function (Blueprint $table) {
$table->id();
$table->bigInteger('company_id')->unsigned();
$table->foreignId('company_id')->unsigned();
$table->string('code');
$table->bigInteger('currency_id')->unsigned();
$table->foreignId('currency_id')->unsigned();
$table->decimal('amount', 20, 5)->default(0.00);
$table->softDeletes();
$table->timestamps();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->foreign('company_id')->references('id')->on('companies');
$table->foreign('currency_id')->references('id')->on('currencies');
});
}
@@ -1,63 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransactionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transaction', function (Blueprint $table) {
$table->id();
$table->string('trans_type1');
$table->string('trans_type2');
$table->bigInteger('bill_no')->unsigned();
$table->decimal('amount', 14, 5)->default(0.00);
$table->decimal('original_amount', 14, 5)->default(0.00);
$table->bigInteger('currency_id')->unsigned();
$table->bigInteger('original_currency_id')->unsigned();
$table->decimal('currency_rate', 14, 5)->default(0.00);
$table->date('dt_transaction');
$table->integer('status');
$table->bigInteger('booking_id')->unsigned();
$table->bigInteger('company_id')->unsigned();
$table->timestamps();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->foreign('original_currency_id')->references('id')->on('currencies')->onDelete('cascade');
});
Schema::create('transaction_detail', function (Blueprint $table) {
$table->id();
$table->string('trans_type1');
$table->string('trans_type2');
$table->bigInteger('transaction_id')->unsigned();
$table->string('product_code');
$table->string('product_name');
$table->integer('qty')->default(0);
$table->decimal('price', 14, 5)->default(0.00);
$table->decimal('amount', 14, 5)->default(0.00);
$table->timestamps();
$table->foreign('transaction_id')->references('id')->on('transaction')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transaction');
Schema::dropIfExists('transaction_detail');
}
}
@@ -0,0 +1,59 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransactionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transactions', function (Blueprint $table) {
$table->id();
$table->foreignId('booking_id')->unsigned();
$table->string('type')->default(TransactionType::PAYMENT);
$table->foreignId('issuer')->unsigned();
$table->foreignId('receiver')->unsigned();
$table->foreignId('recipient_bank_account_id')->unsigned();
$table->string('payment_method')->nullable();
$table->string('payment_reference')->nullable();
$table->string('bill_no')->unique();
$table->decimal('amount', 14, 5)->default(0.00);
$table->decimal('original_amount', 14, 5)->default(0.00);
$table->foreignId('currency_id')->unsigned();
$table->foreignId('original_currency_id')->unsigned();
$table->decimal('currency_rate', 14, 5)->default(0.00);
$table->decimal('tax', 14, 5)->default(0.00);
$table->decimal('service_charge', 14, 5)->default(0.00);
$table->timestamp('expires_on')->nullable();
$table->integer('status')->default(ApprovalStatus::PENDING_SUBMISSION);
$table->softDeletes();
$table->timestamps();
$table->foreign('booking_id')->references('id')->on('bookings');
$table->foreign('currency_id')->references('id')->on('currencies');
$table->foreign('issuer')->references('id')->on('companies');
$table->foreign('receiver')->references('id')->on('companies');
$table->foreign('recipient_bank_account_id')->references('id')->on('banks');
$table->foreign('original_currency_id')->references('id')->on('currencies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transaction');
}
}
@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransactionDetailsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transaction_detail', function (Blueprint $table) {
$table->id();
$table->foreignId('transaction_id')->unsigned();
$table->string('product_code');
$table->string('product_name');
$table->integer('quantity')->default(0);
$table->decimal('price', 14, 5)->default(0.00);
$table->decimal('amount', 14, 5)->default(0.00);
$table->softDeletes();
$table->timestamps();
$table->foreign('transaction_id')->references('id')->on('transactions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transaction_detail');
}
}
@@ -1,5 +1,7 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -16,19 +18,23 @@ class CreateWalletTransactionTable extends Migration
Schema::create('wallet_transaction', function (Blueprint $table) {
$table->id();
$table->bigInteger('wallet_id')->unsigned();
$table->bigInteger('bill_no')->unsigned();
$table->integer('trans_type');
$table->foreignId('wallet_id')->unsigned();
$table->foreignId('transaction_id')->unsigned()->nullable();
$table->foreignId('bill_no')->unsigned();
$table->integer('type')->default(TransactionType::PAYMENT);
$table->decimal('amount', 14, 5)->default(0.00);
$table->bigInteger('currency_id')->unsigned();
$table->foreignId('currency_id')->unsigned();
$table->decimal('original_amount', 14, 5)->default(0.00);
$table->bigInteger('original_currency_id')->unsigned();
$table->foreignId('original_currency_id')->unsigned();
$table->decimal('currency_rate', 14, 5)->default(0.00);
$table->integer('status')->default(ApprovalStatus::PENDING_SUBMISSION);
$table->softDeletes();
$table->timestamps();
$table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade');
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->foreign('original_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->foreign('transaction_id')->references('id')->on('transactions');
$table->foreign('wallet_id')->references('id')->on('wallets');
$table->foreign('currency_id')->references('id')->on('currencies');
$table->foreign('original_currency_id')->references('id')->on('currencies');
});
}
@@ -1,62 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReceiptTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('receipt', function (Blueprint $table) {
$table->id();
$table->string('trans_type1');
$table->string('trans_type2');
$table->bigInteger('bill_no')->unsigned();
$table->decimal('amount', 14, 5)->default(0.00);
$table->decimal('original_amount', 14, 5)->default(0.00);
$table->bigInteger('currency_id')->unsigned();
$table->bigInteger('original_currency_id')->unsigned();
$table->decimal('currency_rate', 14, 5)->default(0.00);
$table->date('dt_transaction');
$table->integer('status');
$table->bigInteger('booking_id')->unsigned();
$table->bigInteger('company_id')->unsigned();
$table->timestamps();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->foreign('original_currency_id')->references('id')->on('currencies')->onDelete('cascade');
});
Schema::create('receipt_detail', function (Blueprint $table) {
$table->id();
$table->string('trans_type1');
$table->string('trans_type2');
$table->bigInteger('receipt_id')->unsigned();
$table->bigInteger('transaction_id')->unsigned();
$table->decimal('price', 14, 5)->default(0.00);
$table->decimal('amount', 14, 5)->default(0.00);
$table->timestamps();
$table->foreign('receipt_id')->references('id')->on('receipt')->onDelete('cascade');
$table->foreign('transaction_id')->references('id')->on('transaction')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('receipt');
Schema::dropIfExists('receipt_detail');
}
}
@@ -0,0 +1,50 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReceiptsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('receipts', function (Blueprint $table) {
$table->id();
$table->foreignId('transaction_id')->unsigned();
$table->string('bill_no')->unique();
$table->decimal('amount', 14, 5)->default(0.00);
$table->decimal('original_amount', 14, 5)->default(0.00);
$table->foreignId('currency_id')->unsigned();
$table->foreignId('original_currency_id')->unsigned();
$table->decimal('currency_rate', 14, 5)->default(0.00);
$table->decimal('tax', 14, 5)->default(0.00);
$table->decimal('service_charge', 14, 5)->default(0.00);
$table->timestamp('transaction_date')->useCurrent();
$table->integer('status')->default(ApprovalStatus::COMPLETED);
$table->softDeletes();
$table->timestamps();
$table->foreign('transaction_id')->references('id')->on('transactions');
$table->foreign('currency_id')->references('id')->on('currencies');
$table->foreign('original_currency_id')->references('id')->on('currencies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('receipt');
}
}
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReceiptDetailsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('receipt_details', function (Blueprint $table) {
$table->id();
$table->foreignId('receipt_id')->unsigned();
$table->decimal('price', 14, 5)->default(0.00);
$table->decimal('amount', 14, 5)->default(0.00);
$table->timestamps();
$table->foreign('receipt_id')->references('id')->on('receipts');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('receipt_detail');
}
}
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Schema;
class CreateCurrencyRatesTable extends Migration
{
/**
* Run the migrations.
*
@@ -16,12 +17,15 @@ class CreateCurrencyRatesTable extends Migration
{
Schema::create('currency_rates', function (Blueprint $table) {
$table->id();
$table->bigInteger('currency_id')->unsigned()->nullable();
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->decimal('selling', 20, 5)->nullable();
$table->foreignId('currency_id')->unsigned();
$table->decimal('selling', 20, 5);
$table->integer('payment_method_type')->default(PaymentMethodType::CASH);
$table->timestamps();
$table->foreignId('service_id');
$table->softDeletes();
$table->timestamps();
$table->foreign('currency_id')->references('id')->on('currencies');
$table->foreign('service_id')->references('id')->on('service_types');
});
}
@@ -15,12 +15,13 @@ class CreateCurrencyRateLogsTable extends Migration
{
Schema::create('currency_rate_logs', function (Blueprint $table) {
$table->id();
$table->bigInteger('currency_rate_id')->unsigned()->nullable();
$table->foreign('currency_rate_id')->references('id')->on('currency_rates')->onDelete('cascade');
$table->decimal('selling', 20, 5)->nullable();
$table->bigInteger('created_by')->unsigned()->nullable();
$table->foreign('created_by')->references('id')->on('users')->onDelete('cascade');
$table->foreignId('currency_rate_id')->unsigned();
$table->decimal('selling', 20, 5);
$table->foreignId('created_by')->unsigned();
$table->timestamps();
$table->foreign('currency_rate_id')->references('id')->on('currency_rates');
$table->foreign('created_by')->references('id')->on('users');
});
}
-18
View File
@@ -1,18 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class AddressesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
if (app()->environment('local'))
factory(App\Models\Address::class, 30)->create();
}
}
+20 -21
View File
@@ -1,7 +1,9 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\RoleTypes;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\DB;
class AdminUserTableSeeder extends Seeder
{
@@ -14,28 +16,25 @@ class AdminUserTableSeeder extends Seeder
{
DB::table('users')->insert([
[
'id' => 1,
'name' => 'The One',
'email' => 'admin@exchange.com',
'password' => bcrypt('pass123'),
'type' => 1,
'status' => 1,
'remember_token' => (string) Str::uuid(),
'active_at' => date('Y-m-d H:i:s'),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'name' => 'Shadow Admin',
'email' => 'omair@cief-malaysia.com',
'password' => bcrypt('123456abcabc'),
'type' => RoleTypes::SHADOW_ADMIN,
'status' => ApprovalStatus::APPROVED,
],
[
'id' => 2,
'name' => 'The Admin',
'email' => 'admin2@exchange.com',
'password' => bcrypt('pass123'),
'type' => 1,
'status' => 1,
'remember_token' => (string) Str::uuid(),
'active_at' => date('Y-m-d H:i:s'),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'name' => 'Super Admin',
'email' => 'pm@cief-malaysia.com',
'password' => bcrypt('123456abcabc'),
'type' => RoleTypes::SUPER_ADMIN,
'status' => ApprovalStatus::APPROVED,
],
[
'name' => 'Admin',
'email' => 'admin@cief-malaysia.com',
'password' => bcrypt('123456abcabc'),
'type' => RoleTypes::ADMIN,
'status' => ApprovalStatus::APPROVED,
]
]);
}
+14 -12
View File
@@ -1,7 +1,11 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\CompanyType;
use App\Models\Company;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\DB;
class CompaniesTableSeeder extends Seeder
{
@@ -12,16 +16,14 @@ class CompaniesTableSeeder extends Seeder
*/
public function run()
{
DB::table('companies')->insert([
[
'id' => 1,
'name' => 'CIEF SDN BHD',
'reference' => 'CIEF',
'type' => 2,
'business_type' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
]
]);
$company = new Company();
$company->name = 'CIEF SDN BHD';
$company->reference = 'CIEF';
$company->type = CompanyType::COMPANY_BUSINESS;
$company->business_type = BusinessType::FREIGHT_FORWARDER;
$company->status = ApprovalStatus::APPROVED;
$company->save();
}
}
@@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
class CompanyBanksTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('company_banks')->insert([
[
'id' => 1,
'country_id' => 1,
'company_id' => 1,
'bank_name' => '12345678',
'holder_name' => '12345678',
'account_no' => '12345678',
'type' => 1,
'default' => 1,
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
]
]);
}
}
+23 -19
View File
@@ -1,34 +1,38 @@
<?php
use App\Classes\Modules\Countries\DataTransferObjects\CountryObject;
use App\Classes\Modules\Countries\Services\CreatesCountry;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
class CountriesTableSeeder extends Seeder
{
/** @var CreatesCountry */
private $createsCountry;
/**
* CountriesTableSeeder constructor.
* @param CreatesCountry $createsCountry
*/
public function __construct(CreatesCountry $createsCountry)
{
$this->createsCountry = $createsCountry;
}
/**
* Run the database seeds.
*
* @return void
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function run()
{
DB::table('countries')->insert([
[
'id' => 1,
'name' => 'Malaysia',
'short_code' => 'MY',
'phone_code' => '60',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
],
[
'id' => 2,
'name' => 'China',
'short_code' => 'CN',
'phone_code' => '852',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]
]);
foreach (['my', 'cn'] as $code) {
$object = new CountryObject(country($code));
$this->createsCountry->execute($object);
}
}
}
+32 -21
View File
@@ -1,36 +1,47 @@
<?php
use App\Classes\Modules\Countries\Services\FetchesCountry;
use App\Classes\Modules\Currencies\DataTransferObjects\CurrencyObject;
use App\Classes\Modules\Currencies\Services\CreatesCurrency;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
class CurrenciesTableSeeder extends Seeder
{
/** @var FetchesCountry */
private $fetchesCountry;
/** @var CreatesCurrency */
private $createsCurrency;
/**
* CurrenciesTableSeeder constructor.
* @param FetchesCountry $fetchesCountry
* @param CreatesCurrency $createsCurrency
*/
public function __construct(FetchesCountry $fetchesCountry, CreatesCurrency $createsCurrency)
{
$this->fetchesCountry = $fetchesCountry;
$this->createsCurrency = $createsCurrency;
}
/**
* Run the database seeds.
*
* @return void
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function run()
{
DB::table('currencies')->insert([
[
'id' => 1,
'country_id' => 1,
'name' => 'Ringgit',
'short_code' => 'MYR',
'symbol' => 'RM',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
],
[
'id' => 2,
'country_id' => 2,
'name' => 'Renminbi',
'short_code' => 'RMB',
'symbol' => '¥',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
]
]);
foreach (['my', 'cn'] as $code) {
$country = country($code);
$object = new CurrencyObject($country->getCurrency()['iso_4217_name'],
$code === 'cn' ? 'RMB' : $country->getCurrency()['iso_4217_code'],
$code === 'my' ? 'RM' : ( $code === 'cn' ? '¥' : '' ));
$this->createsCurrency->execute($this->fetchesCountry->execute(['name' => $country->getName()]), $object);
}
}
}
@@ -1,47 +0,0 @@
<?php
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
class CurrencyRatesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('currency_rates')->insert([
[
'currency_id' => 1,
'selling' => 1,
'payment_method_type' => PaymentMethodType::CASH,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
],
[
'currency_id' => 1,
'selling' => 1.1,
'payment_method_type' => PaymentMethodType::CHEQUE,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
],
[
'currency_id' => 2,
'selling' => 0.62,
'payment_method_type' => PaymentMethodType::CASH,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
],
[
'currency_id' => 2,
'selling' => 0.70,
'payment_method_type' => PaymentMethodType::CHEQUE,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
]
]);
}
}
+2 -3
View File
@@ -1,6 +1,7 @@
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DatabaseSeeder extends Seeder
{
@@ -16,7 +17,6 @@ class DatabaseSeeder extends Seeder
//General
$this->call(CountriesTableSeeder::class);
$this->call(CurrenciesTableSeeder::class);
$this->call(CurrencyRatesTableSeeder::class);
$this->call(StatesTableSeeder::class);
$this->call(DistrictsTableSeeder::class);
@@ -25,8 +25,7 @@ class DatabaseSeeder extends Seeder
$this->call(SegmentConstantsTableSeeder::class);
$this->call(CompaniesTableSeeder::class);
$this->call(CompanyBanksTableSeeder::class);
// Admin
$this->call(AdminUserTableSeeder::class);
$this->call(AdminUserPermissionsTableSeeder::class);
+1 -3
View File
@@ -1,7 +1,7 @@
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\DB;
class DistrictsTableSeeder extends Seeder
{
@@ -468,8 +468,6 @@ class DistrictsTableSeeder extends Seeder
'name' => $row[3],
'postcode' => $row[4],
'status' => $row[5],
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
];
}
+37 -64
View File
@@ -1,79 +1,52 @@
<?php
use App\Classes\Modules\Currencies\Services\FetchesCurrency;
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
use App\Classes\Modules\Segments\Services\CreatesConstant;
use App\Classes\Modules\Segments\Services\FetchesSegment;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
class SegmentConstantsTableSeeder extends Seeder
{
/** @var FetchesCurrency */
private $fetchesCurrency;
/** @var FetchesSegment */
private $fetchesSegment;
/** @var CreatesConstant */
private $createsSegmentConstant;
/**
* SegmentConstantsTableSeeder constructor.
* @param FetchesCurrency $fetchesCurrency
* @param FetchesSegment $fetchesSegment
* @param CreatesConstant $createsSegmentConstant
*/
public function __construct(FetchesCurrency $fetchesCurrency, FetchesSegment $fetchesSegment, CreatesConstant $createsSegmentConstant)
{
$this->fetchesCurrency = $fetchesCurrency;
$this->fetchesSegment = $fetchesSegment;
$this->createsSegmentConstant = $createsSegmentConstant;
}
/**
* Run the database seeds.
*
* @return void
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function run()
{
DB::table('segment_constants')->insert([
[
'id' => 1,
'segment_id' => 1,
'name' => 'Tax',
'reference' => 'TAX',
'detail' => json_encode([
'type' => 'percentage',
'value' => '10'
]),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
],
[
'id' => 2,
'segment_id' => 1,
'name' => 'Billing Fee',
'reference' => 'BILLING_FEE',
'detail' => json_encode([
'type' => 'fix_rate',
'value' => '10'
]),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
],
[
'id' => 3,
'segment_id' => 1,
'name' => 'Service Charge',
'reference' => 'SERVICE_CHARGE',
'detail' => json_encode([
'type' => 'fix_rate',
'value' => '10'
]),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
],
[
'id' => 4,
'segment_id' => 1,
'name' => 'Booking Amount Max',
'reference' => 'BOOKING_AMOUNT_MAX',
'detail' => json_encode([
'type' => 'fix_rate',
'value' => '10',
'currency_id' => 1
]),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
],
[
'id' => 5,
'segment_id' => 1,
'name' => 'Payment Attempt Expiry Time',
'reference' => 'PAYMENT_ATTEMP_EXPIRY_TIME',
'detail' => json_encode([
'type' => 'day',
'value' => '10',
]),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
],
]);
$object = new ConstantObject('System Primary Currency',
SegmentConstants::SYSTEM_PRIMARY_CURRENCY,
['id' => $this->fetchesCurrency->execute(['name' => country('my')->getName()])->id]);
$this->createsSegmentConstant->execute($this->fetchesSegment->execute(['Standard Segment']), $object);
}
}
+9 -10
View File
@@ -1,24 +1,23 @@
<?php
use App\Classes\Modules\Segments\DataTransferObjects\SegmentObject;
use App\Classes\Modules\Segments\Services\CreatesSegment;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\DB;
class SegmentsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('segments')->insert([
[
'id' => 1,
'name' => 'Standard Segment',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]
'name' => 'Standard Segment',
'type' => SegmentConstants::STANDARD_SEGMENT
]);
}
}
+51 -81
View File
@@ -1,10 +1,25 @@
<?php
use App\Classes\Modules\Countries\Services\FetchesCountry;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\DB;
class StatesTableSeeder extends Seeder
{
/** @var FetchesCountry */
private $fetchesCountry;
/**
* StatesTableSeeder constructor.
* @param FetchesCountry $fetchesCountry
*/
public function __construct(FetchesCountry $fetchesCountry)
{
$this->fetchesCountry = $fetchesCountry;
}
/**
* Run the database seeds.
*
@@ -12,134 +27,89 @@ class StatesTableSeeder extends Seeder
*/
public function run()
{
$malaysia = $this->fetchesCountry->execute(['name' => country('my')->getName()]);
DB::table('states')->insert([
[
'id' => 1,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Johor',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 2,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Kedah',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 3,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Kelantan',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 4,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Kuala Lumpur',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 5,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Labuan',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 6,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Melaka',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 7,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Negeri Sembilan',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 8,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Pahang',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 9,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Perak',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 10,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Perlis',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 11,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Pulau Pinang',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 12,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Putrajaya',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 13,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Sabah',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 14,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Sarawak',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 15,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Selangor',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
],
[
'id' => 16,
'country_id' => 1,
'country_id' => $malaysia->id,
'name' => 'Terengganu',
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'status' => 1
]
]);
}