'boolean', 'tahun_prestasi' => 'integer', 'urutan' => 'integer' ]; public function admin() { return $this->belongsTo(Admin::class); } public function jurusan() { return $this->belongsTo(Jurusan::class, 'jurusan_id'); } public function getFotoPrestasiUrlAttribute() { if ($this->foto_prestasi) { return asset('storage/prestasi/' . $this->foto_prestasi); } return asset('images/default-img.png'); } public function scopeActive($query) { return $query->where('status', true); } public function scopeOrdered($query) { return $query->orderBy('urutan', 'desc')->orderBy('created_at', 'desc'); } }