'array', 'required_assets' => 'array', 'is_active' => 'boolean', ]; // Scopes public function scopeActive($query) { return $query->where('is_active', true); } // Helpers public function getPatterns() { if (empty($this->pattern_ids)) { return collect(); } return Pattern::whereIn('id', $this->pattern_ids)->get(); } public function getRequiredAssetsObjects(): array { if (empty($this->required_assets)) { return []; } return Asset::whereIn('slug', $this->required_assets)->get()->all(); } // For MCP context public function toMcpContext(): array { return [ 'name' => $this->name, 'slug' => $this->slug, 'description' => $this->description, 'patterns' => $this->getPatterns()->map(fn ($p) => $p->toMcpContext())->all(), 'required_assets' => $this->required_assets, ]; } }