Memperbarui UI/UX

This commit is contained in:
2026-06-07 23:32:06 +07:00
parent f7479770e6
commit 76a8782409
47 changed files with 4378 additions and 685 deletions
@@ -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::table('users', function (Blueprint $table) {
$table->foreignId('id_tempat_ibadah')->nullable()->constrained('tempat_ibadah')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropForeign(['id_tempat_ibadah']);
$table->dropColumn('id_tempat_ibadah');
});
}
};
@@ -0,0 +1,31 @@
<?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('log_distribusi', function (Blueprint $table) {
$table->id();
$table->foreignId('id_penerima')->constrained('penerima_bantuan')->onDelete('cascade');
$table->dateTime('tanggal_diterima');
$table->string('status')->default('Menunggu');
$table->text('foto_penyerahan')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('log_distribusi');
}
};
@@ -0,0 +1,60 @@
<?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::table('tempat_ibadah', function (Blueprint $table) {
// Rename kontak_person to kontak_pengurus
$table->renameColumn('kontak_person', 'kontak_pengurus');
});
Schema::table('tempat_ibadah', function (Blueprint $table) {
// Add new columns
$table->string('nama_pengurus')->nullable()->after('kontak_pengurus');
});
Schema::table('penerima_bantuan', function (Blueprint $table) {
// Rename foto_kondisi_rumah to foto (multi-foto, comma-separated)
$table->renameColumn('foto_kondisi_rumah', 'foto');
});
Schema::table('penerima_bantuan', function (Blueprint $table) {
// Change foto column to text for multi-file support
$table->text('foto')->nullable()->change();
// Add new columns
$table->double('jarak_ke_penyalur')->nullable()->after('foto');
$table->string('dokumen_laporan')->nullable()->after('jarak_ke_penyalur');
$table->dateTime('tanggal_pencairan_terakhir')->nullable()->after('dokumen_laporan');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('penerima_bantuan', function (Blueprint $table) {
$table->dropColumn(['jarak_ke_penyalur', 'dokumen_laporan', 'tanggal_pencairan_terakhir']);
});
Schema::table('penerima_bantuan', function (Blueprint $table) {
$table->renameColumn('foto', 'foto_kondisi_rumah');
});
Schema::table('tempat_ibadah', function (Blueprint $table) {
$table->dropColumn(['nama_pengurus']);
});
Schema::table('tempat_ibadah', function (Blueprint $table) {
$table->renameColumn('kontak_pengurus', 'kontak_person');
});
}
};
@@ -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::table('penerima_bantuan', function (Blueprint $table) {
$table->enum('status_persetujuan', ['menunggu', 'disetujui', 'ditolak'])->default('menunggu');
$table->text('alasan_penolakan')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('penerima_bantuan', function (Blueprint $table) {
$table->dropColumn(['status_persetujuan', 'alasan_penolakan']);
});
}
};
@@ -0,0 +1,25 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
DB::table('users')->where('role', 'admin_ibadah')->update(['role' => 'user']);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
DB::table('users')->where('role', 'user')->update(['role' => 'admin_ibadah']);
}
};
@@ -0,0 +1,28 @@
<?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::table('tempat_ibadah', function (Blueprint $table) {
$table->string('password')->nullable()->after('radius_meter');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('tempat_ibadah', function (Blueprint $table) {
$table->dropColumn('password');
});
}
};
@@ -0,0 +1,31 @@
<?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('laporan_wargas', function (Blueprint $table) {
$table->id();
$table->string('nama_calon');
$table->integer('jumlah_tanggungan');
$table->string('foto')->nullable();
$table->enum('status_laporan', ['menunggu', 'diproses'])->default('menunggu');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('laporan_wargas');
}
};
@@ -0,0 +1,28 @@
<?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::table('laporan_wargas', function (Blueprint $table) {
$table->text('deskripsi')->nullable()->after('jumlah_tanggungan');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('laporan_wargas', function (Blueprint $table) {
$table->dropColumn('deskripsi');
});
}
};
@@ -0,0 +1,28 @@
<?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::table('penerima_bantuan', function (Blueprint $table) {
//
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('penerima_bantuan', function (Blueprint $table) {
//
});
}
};
@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('tempat_ibadah', function (Blueprint $table) {
$table->string('kode_lapor')->nullable()->unique()->after('id');
});
Schema::table('laporan_wargas', function (Blueprint $table) {
$table->unsignedBigInteger('id_tempat_ibadah')->nullable()->after('id');
// Foreign key jika menggunakan InnoDB, namun karena mungkin ada data tidak sinkron, biarkan saja index biasa.
$table->index('id_tempat_ibadah');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('laporan_wargas', function (Blueprint $table) {
$table->dropColumn('id_tempat_ibadah');
});
Schema::table('tempat_ibadah', function (Blueprint $table) {
$table->dropColumn('kode_lapor');
});
}
};
@@ -0,0 +1,28 @@
<?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::table('laporan_wargas', function (Blueprint $table) {
$table->string('alamat')->nullable()->after('jumlah_tanggungan');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('laporan_wargas', function (Blueprint $table) {
$table->dropColumn('alamat');
});
}
};