Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
rimasazkya14 2026-05-05 15:09:35 +07:00
parent d6a818609a
commit 59688e2337
4 changed files with 52 additions and 36 deletions

View File

@ -20,14 +20,14 @@ LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug LOG_LEVEL=debug
DB_CONNECTION=sqlite DB_CONNECTION=mysql
# DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
# DB_PORT=3306 DB_PORT=3306
# DB_DATABASE=laravel DB_DATABASE=laravel
# DB_USERNAME=root DB_USERNAME=root
# DB_PASSWORD= DB_PASSWORD=
SESSION_DRIVER=database SESSION_DRIVER=cookie
SESSION_LIFETIME=120 SESSION_LIFETIME=120
SESSION_ENCRYPT=false SESSION_ENCRYPT=false
SESSION_PATH=/ SESSION_PATH=/
@ -47,14 +47,15 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
MAIL_MAILER=log MAIL_MAILER=smtp
MAIL_SCHEME=null MAIL_HOST=smtp.gmail.com
MAIL_HOST=127.0.0.1 MAIL_PORT=587
MAIL_PORT=2525 MAIL_ENCRYPTION=tls
MAIL_USERNAME=null MAIL_USERNAME=rimasazkya@gmail.com
MAIL_PASSWORD=null MAIL_PASSWORD="uamw iegn gjtg dkuw"
MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_ADDRESS=SiJentik@noreply.com
MAIL_FROM_NAME="${APP_NAME}" # MAIL_FROM_NAME="${APP_NAME}"
MAIL_FROM_NAME="SiJentik"
AWS_ACCESS_KEY_ID= AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY= AWS_SECRET_ACCESS_KEY=

View File

@ -13,14 +13,16 @@ public function up(): void
$table->string('name'); $table->string('name');
$table->string('email')->unique(); $table->string('email')->unique();
$table->string('address'); $table->string('address');
$table->string('rtrw'); $table->string('profile_photo')->nullable();
$table->string('password'); $table->string('password');
$table->string('role')->default('Kader'); $table->string('role')->default('user');
$table->enum('status', ['pending', 'approved', 'rejected'])->default('pending'); $table->enum('status', ['pending', 'approved', 'rejected'])->default('pending');
$table->string('otp')->nullable(); $table->string('otp')->nullable();
$table->timestamp('otp_expires_at')->nullable(); $table->timestamp('otp_expires_at')->nullable();
$table->string('rtrw');
$table->timestamps(); $table->timestamps();
}); });
} }

View File

@ -7,26 +7,39 @@
return new class extends Migration return new class extends Migration
{ {
public function up() public function up()
{Schema::create('laporan', function (Blueprint $table) { {
$table->id(); Schema::create('laporan', function (Blueprint $table) {
$table->string('judul'); $table->id();
$table->boolean('ada_jentik')->default(false); $table->string('judul');
$table->date('tanggal'); $table->boolean('ada_jentik');
$table->decimal('latitude', 10, 7)->nullable(); $table->date('tanggal');
$table->decimal('longitude', 10, 7)->nullable(); $table->decimal('latitude', 10, 7)->nullable();
$table->string('alamat')->nullable(); $table->decimal('longitude', 10, 7)->nullable();
$table->string('gambar')->nullable(); $table->text('alamat')->nullable();
$table->enum('status_kader', ['Menunggu','Diproses','Selesai','Ditolak'])->default('Menunggu'); $table->string('gambar')->nullable();
$table->enum('status_petugas', ['Menunggu','Diproses','Selesai','Ditolak'])->default('Menunggu'); $table->enum('status', ['proses','diterima','ditolak'])->default('proses');
$table->enum('prioritas', ['Tinggi','Sedang','Rendah'])->default('Sedang'); $table->text('catatan_petugas')->nullable();
$table->string('kader')->nullable();
$table->text('catatan_petugas')->nullable(); $table->timestamps();
$table->timestamps();
}); $table->unsignedBigInteger('user_id')->nullable();
} $table->unsignedBigInteger('verifikator_id')->nullable();
$table->index('user_id', 'fk_laporan_user');
$table->index('verifikator_id', 'fk_verifikator');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
$table->foreign('verifikator_id')->references('id')->on('users');
});
}
public function down(): void public function down(): void
{ {
Schema::table('laporan', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->dropForeign(['verifikator_id']);
});
Schema::dropIfExists('laporan'); Schema::dropIfExists('laporan');
} }
}; };

View File

@ -24,8 +24,8 @@ public function run(): void
'status' => 'approved', 'status' => 'approved',
]); ]);
// create 10 random users // create 5 random users
for ($i = 0; $i < 10; $i++) { for ($i = 0; $i < 5; $i++) {
$user = User::factory()->make(); $user = User::factory()->make();
$user->address = fake()->address(); $user->address = fake()->address();
$user->rtrw = fake()->bothify('##/##'); $user->rtrw = fake()->bothify('##/##');