'boolean', 'urutan' => 'integer', ]; public function admin() { return $this->belongsTo(Admin::class); } /** * Get foto pengumuman URL */ public function getFotoPengumumanUrlAttribute() { if ($this->foto_pengumuman) { return url('/storage/pengumuman/'.$this->foto_pengumuman); } return asset('images/default-img.png'); } /** * Get deskripsi pendek */ public function getDeskripsiPendekAttribute() { return Str::limit($this->deskripsi_pengumuman, 100); } /** * Scope untuk pengumuman aktif */ public function scopeActive($query) { return $query->where('status', true); } /** * Scope untuk urutan */ public function scopeOrdered($query) { return $query->orderBy('urutan', 'desc')->orderBy('created_at', 'desc'); } }