35 lines
705 B
PHP
35 lines
705 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PeriodeSeleksi extends Model
|
|
{
|
|
protected $table = 'periode_seleksi';
|
|
|
|
protected $fillable = [
|
|
'nama',
|
|
'tanggal_mulai',
|
|
'tanggal_selesai',
|
|
'kuota_penerima',
|
|
'kuota_cadangan',
|
|
'status',
|
|
];
|
|
|
|
// ✅ TAMBAHKAN INI untuk casting otomatis ke date
|
|
protected $casts = [
|
|
'tanggal_mulai' => 'date',
|
|
'tanggal_selesai' => 'date',
|
|
];
|
|
|
|
public function penilaian()
|
|
{
|
|
return $this->hasMany(PenilaianWarga::class, 'periode_id');
|
|
}
|
|
|
|
public function hasilSaw()
|
|
{
|
|
return $this->hasMany(HasilSaw::class, 'periode_id');
|
|
}
|
|
} |