add banks, payment purpose and user company tables
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('payment_purpose_codes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->nullable()->index();
|
||||
$table->string('code')->nullable()->unique();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('payment_purpose_codes');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\PaymentPurposeCode\Database\Seeders;
|
||||
|
||||
use App\Modules\PaymentPurposeCode\Models\PaymentPurposeCode;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
class PaymentPurposeCodeSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$data = collect(File::json(__DIR__.'/../../Resources/Data/data.json'));
|
||||
|
||||
$data->each(function ($item) {
|
||||
PaymentPurposeCode::create(['code' => $item['key'], 'name' => $item['value']]);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user