'datetime', ]; public function tasks(): HasMany { return $this->hasMany(Task::class)->orderBy('priority', 'desc')->orderBy('created_at'); } public function ideas(): HasMany { return $this->hasMany(Idea::class)->orderBy('priority', 'desc')->orderBy('created_at', 'desc'); } public function activeTasks() { return $this->tasks()->whereIn('status', ['todo', 'in_progress', 'waiting_review']); } public function completedTasks() { return $this->tasks()->where('status', 'done'); } public function scopeActive($query) { return $query->where('status', 'active'); } public function scopeCompleted($query) { return $query->where('status', 'completed'); } }