feat: menu & API Informasi Sekolah untuk aplikasi wali
- Tabel school_informations (judul, isi, kategori, tanggal kegiatan, publish) - Menu admin 'Informasi Sekolah' (CRUD + permission manage-school-info) - API wali: GET /parent/school-informations (hanya yang dipublikasikan) - 2 data contoh: Jadwal UTS & Class Meet - Test suite tetap hijau (39 test)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SchoolInformation extends Model
|
||||
{
|
||||
protected $table = 'school_informations';
|
||||
|
||||
protected $fillable = [
|
||||
'title', 'content', 'category', 'event_date', 'is_published', 'published_at', 'created_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'event_date' => 'date',
|
||||
'is_published' => 'boolean',
|
||||
'published_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function creator()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user