32 lines
959 B
PHP
32 lines
959 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Laravel\Passport\HasApiTokens;
|
|
|
|
class Voter extends Authenticatable
|
|
{
|
|
use HasApiTokens;
|
|
|
|
protected $table = 'voter';
|
|
|
|
protected $fillable = ['name', 'no_kp', 'no_anggota','unit', 'election_id', 'alamat', 'telefon', 'saham', 'yuran', 'dividen_saham', 'dividen_yuran', 'kehadiran','status_penyata','persetujuan','tarikh_sah','cadangan','pelaburan', 'accumulated_amount', 'tergempar','barangan','peribadi','berjamin_yuran','roadtax','pelbagai'];
|
|
|
|
protected $casts = [
|
|
'fizikal_registration_verified_at' => 'datetime',
|
|
];
|
|
|
|
/**
|
|
* Fizikal attendees must be counter-verified by admin; Maya does not use this gate.
|
|
*/
|
|
public function isFizikalRegistrationVerifiedForVoting(): bool
|
|
{
|
|
if ((int) $this->kehadiran !== 1) {
|
|
return true;
|
|
}
|
|
|
|
return $this->fizikal_registration_verified_at !== null;
|
|
}
|
|
}
|