belongsTo(\App\Models\User::class); } /** * Get the image URL attribute */ public function getGambarUrlAttribute() { if ($this->gambar) { return asset('storage/' . $this->gambar); } return null; } /** * Scope for published berita */ public function scopePublished($query) { return $query->where('status', 'published'); } /** * Scope for draft berita */ public function scopeDraft($query) { return $query->where('status', 'draft'); } }