Skip to main content
Glama
AnalyzeFacadesTool.php1.52 kB
<?php declare(strict_types=1); namespace GoldenPathDigital\LaravelAscend\Tools\Code; use GoldenPathDigital\LaravelAscend\Tools\ProjectAwareTool; final class AnalyzeFacadesTool extends ProjectAwareTool { public function getName(): string { return 'analyze_facades'; } public function getDescription(): string { return 'Identify Laravel facade usages within the project.'; } public function getInputSchema(): array { return $this->buildSchema( $this->baseProjectProperties() ); } public function execute(array $payload): array { $startedAt = microtime(true); $context = $this->createContext($payload); $scanner = $this->createScanner($context); $phpFiles = $scanner->findByPatterns(['app/**/*.php', 'routes/**/*.php']); $facades = []; foreach ($phpFiles as $path) { $matches = $scanner->findRegexMatches($path, [ 'Illuminate\\\\Support\\\\Facades\\\\[A-Z][A-Za-z]+', 'Facade::', ]); if ($matches === []) { continue; } $facades[] = [ 'file' => $scanner->toRelativePath($path), 'occurrences' => $matches, ]; } return $this->success( [ 'facade_usages' => $facades, 'count' => count($facades), ], [], $startedAt ); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aarongrtech/laravel-ascend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server