diff --git a/app/Voter.php b/app/Voter.php index 6c00b2c..33ff416 100644 --- a/app/Voter.php +++ b/app/Voter.php @@ -10,5 +10,5 @@ class Voter extends Authenticatable use HasApiTokens; protected $table = 'voter'; - protected $fillable = ['name', 'no_kp', 'no_anggota','unit', 'election_id', 'alamat', 'telefon', 'saham', 'yuran', 'kehadiran']; + protected $fillable = ['name', 'no_kp', 'no_anggota','unit', 'election_id', 'alamat', 'telefon', 'saham', 'yuran', 'kehadiran','status_penyata','persetujuan','tarikh_sah','cadangan','pelaburan','tergempar','barangan','peribadi','berjamin_yuran','roadtax','pelbagai']; } diff --git a/database/migrations/2026_01_22_160325_add_penyata_columns_to_voter_table.php b/database/migrations/2026_01_22_160325_add_penyata_columns_to_voter_table.php new file mode 100644 index 0000000..c94a056 --- /dev/null +++ b/database/migrations/2026_01_22_160325_add_penyata_columns_to_voter_table.php @@ -0,0 +1,35 @@ +enum('persetujuan', ['Bersetuju', 'Tidak Bersetuju'])->nullable()->after('kehadiran'); + $table->enum('status_penyata', ['DRAF', 'DISAHKAN', 'PERLU_SEMAK'])->default('DRAF')->after('persetujuan'); + $table->dateTime('tarikh_sah')->nullable()->after('status_penyata'); + $table->json('cadangan')->nullable()->after('tarikh_sah'); + }); + } + + public function down() + { + Schema::table('voter', function (Blueprint $table) { + $table->dropColumn([ + 'persetujuan', + 'status_penyata', + 'tarikh_sah', + 'cadangan' + ]); + }); + } +} diff --git a/database/migrations/2026_02_23_131618_add_pelaburan_to_voter_table.php b/database/migrations/2026_02_23_131618_add_pelaburan_to_voter_table.php new file mode 100644 index 0000000..58aecdf --- /dev/null +++ b/database/migrations/2026_02_23_131618_add_pelaburan_to_voter_table.php @@ -0,0 +1,48 @@ +decimal('pelaburan', 12, 2)->default(0)->after('yuran'); + $table->decimal('tergempar', 12, 2)->default(0)->after('pelaburan'); + $table->decimal('barangan', 12, 2)->default(0)->after('tergempar'); + $table->decimal('peribadi', 12, 2)->default(0)->after('barangan'); + $table->decimal('berjamin_yuran', 12, 2)->default(0)->after('peribadi'); + $table->decimal('roadtax', 12, 2)->default(0)->after('berjamin_yuran'); + $table->decimal('pelbagai', 12, 2)->default(0)->after('roadtax'); + + }); +} + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('voter', function (Blueprint $table) { + // + $table->dropColumn([ + 'pelaburan', + 'tergempar', + 'barangan', + 'peribadi', + 'berjamin_yuran', + 'roadtax', + 'pelbagai' + ]); + }); + } +}