29 lines
630 B
PHP
29 lines
630 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Pengumuman extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
// Karena nama tabelnya 'pengumuman' (bukan pengumumans)
|
|
protected $table = 'pengumuman';
|
|
|
|
protected $fillable = [
|
|
'judul',
|
|
'isi',
|
|
'tanggal_mulai',
|
|
'tanggal_selesai',
|
|
'status',
|
|
];
|
|
|
|
// Casting agar tanggal otomatis jadi Carbon (bisa diformat tgl-bln-thn)
|
|
protected $casts = [
|
|
'tanggal_mulai' => 'date',
|
|
'tanggal_selesai' => 'date',
|
|
'status' => 'boolean',
|
|
];
|
|
} |