'boolean' ]; protected $attributes = [ 'is_active' => true ]; /** * Get the user that owns the KPI target */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get the achievements for this target */ public function achievements(): HasMany { return $this->hasMany(KpiAchievement::class); } /** * Scope to get active targets */ public function scopeActive($query) { return $query->where('is_active', true); } /** * Check if target is currently active */ public function isCurrentlyActive(): bool { return $this->is_active; } }