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

View File

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

View File

@ -7,26 +7,39 @@
return new class extends Migration
{
public function up()
{Schema::create('laporan', function (Blueprint $table) {
$table->id();
$table->string('judul');
$table->boolean('ada_jentik')->default(false);
$table->date('tanggal');
$table->decimal('latitude', 10, 7)->nullable();
$table->decimal('longitude', 10, 7)->nullable();
$table->string('alamat')->nullable();
$table->string('gambar')->nullable();
$table->enum('status_kader', ['Menunggu','Diproses','Selesai','Ditolak'])->default('Menunggu');
$table->enum('status_petugas', ['Menunggu','Diproses','Selesai','Ditolak'])->default('Menunggu');
$table->enum('prioritas', ['Tinggi','Sedang','Rendah'])->default('Sedang');
$table->string('kader')->nullable();
$table->text('catatan_petugas')->nullable();
$table->timestamps();
});
}
{
Schema::create('laporan', function (Blueprint $table) {
$table->id();
$table->string('judul');
$table->boolean('ada_jentik');
$table->date('tanggal');
$table->decimal('latitude', 10, 7)->nullable();
$table->decimal('longitude', 10, 7)->nullable();
$table->text('alamat')->nullable();
$table->string('gambar')->nullable();
$table->enum('status', ['proses','diterima','ditolak'])->default('proses');
$table->text('catatan_petugas')->nullable();
$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
{
Schema::table('laporan', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->dropForeign(['verifikator_id']);
});
Schema::dropIfExists('laporan');
}
};

View File

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