first commit
This commit is contained in:
37
app/Models/KehadiranTaklimat.php
Normal file
37
app/Models/KehadiranTaklimat.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Sppm\PetugasPermohonan;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class KehadiranTaklimat extends Model
|
||||
{
|
||||
protected $table = 'kehadiran_taklimat';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'hadir_at' => 'datetime',
|
||||
'borang_diambil' => 'boolean',
|
||||
'borang_diambil_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function sesi(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SesiTaklimat::class, 'sesi_taklimat_id');
|
||||
}
|
||||
|
||||
public function permohonan(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PetugasPermohonan::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Nombor siri berpad minimum 3 digit (001, 002, 1001).
|
||||
*/
|
||||
public function getNomborSiriPaparAttribute(): string
|
||||
{
|
||||
return str_pad((string) $this->nombor_siri, 3, '0', STR_PAD_LEFT);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user