Download the PHP package maarheeze/codegraph-laravel without Composer

On this page you can find all versions of the php package maarheeze/codegraph-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package codegraph-laravel

maarheeze/codegraph-laravel

Instant code understanding for Laravel applications.

This package extends maarheeze/codegraph to automatically extract and index Laravel patterns—routes, models, services, and dependencies. Understand your codebase instantly without guessing, grepping, or slow IDE searches.

Why Use It?

Answer questions about your Laravel app in milliseconds.

How it helps:

What It Extracts

This package extends CodeGraph with Laravel-aware extraction:

Installation

The package auto-registers via Laravel's service provider system. No additional configuration needed.

Usage

Initialize and Index Your Application

First, initialize CodeGraph:

Then, index your application:

By default, init sets up the CLI integration — the cheapest path for AI assistants. The init command:

CLI mode does not write .mcp.json, publish routes/ai.php, or touch Claude Code settings. AI assistants discover the CLI once via CLAUDE.md and only spend tokens when they actually run a command — unlike MCP, whose tool definitions are loaded into context on every session whether they are used or not.

The index command scans your app/ and routes/ directories and extracts all Laravel patterns into the database. This directory is auto-generated and should be added to .gitignore.

Querying the Index (CLI)

The CLI ships with the core maarheeze/codegraph dependency and queries the same .codegraph/index.sqlite database that the Laravel indexer fills:

Each command prints JSON to stdout.

MCP Integration (opt-in)

If you prefer the MCP integration, pass the --mcp flag:

This restores the full MCP setup:

You can override environment detection with --mcp-config=auto|sail|docker|php.

View Indexing Status

Shows what was extracted: routes, relations, service bindings, and other patterns.

Using Your Index

Once indexed, your code graph is ready to use:

MCP Tools for Claude Code

After running codegraph:init --mcp and codegraph:index, Claude Code has access to 3 Laravel-specific MCP tools powered by Laravel MCP:

codegraph_find_route

Find Laravel routes by URL pattern or name.

Returns: Route path, HTTP method, controller method, file location

codegraph_find_model

Find Eloquent models and their relations.

Returns: Model FQN, file path, all hasMany/belongsTo/morphs relations with related models

codegraph_find_service

Find service container bindings.

Returns: Binding key, concrete class, service provider, file location

These tools work alongside CodeGraph's 5 core tools (search, callers, callees, blast_radius, search_chunks) to give Claude Code complete understanding of your Laravel application. The MCP server is automatically started using Laravel's native MCP framework based on your environment (Sail, Docker, or plain PHP) as detected during codegraph:init --mcp.

Migrating from MCP to the CLI

MCP tool definitions are loaded into the AI assistant's context on every session, whether or not they are used. The CLI is discovered once via CLAUDE.md and only costs tokens when a command actually runs. To switch an existing MCP setup over to the CLI:

  1. Remove the <!-- codegraph --><!-- /codegraph --> block from CLAUDE.md.
  2. Delete the codegraph entry from .mcp.json.
  3. Remove codegraph from enabledMcpjsonServers in .claude/settings.local.json.
  4. Remove (or guard) the published routes/ai.php MCP registration.
  5. Re-run php artisan codegraph:init.

Automatic Indexing on Install

To automatically initialize and index your codebase after dependencies are installed or updated, add the following to your composer.json:

This ensures your code graph is initialized and stays in sync whenever dependencies change or the codebase is freshly checked out.

Architecture

The package implements the CodeGraph plugin system:

All extractors extend BaseAstVisitor and work with the AST (Abstract Syntax Tree) to ensure accuracy.

How It Works

  1. Register plugin — LaravelPlugin registers all extractors with CodeGraph
  2. Scan files — Discovers and parses PHP files in app/, routes/, and configurable directories
  3. Extract patterns — Each extractor identifies Laravel-specific patterns in the AST (Abstract Syntax Tree)
  4. Build graph — Creates nodes for routes, models, services, and edges for dependencies
  5. Persist index — Stores the complete code graph in SQLite for fast, offline querying
  6. Resolve references — CodeGraph resolves all cross-file references automatically

The index is incremental — subsequent runs only re-scan changed files, keeping indexing fast even on large codebases.

Use Cases

License

MIT


All versions of codegraph-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
ext-pdo Version *
ext-pdo_sqlite Version *
illuminate/console Version ^13.0
illuminate/support Version ^13.0
laravel/mcp Version ^0.7.1
maarheeze/codegraph Version ^2.0
nikic/php-parser Version ^5.7
webmozart/assert Version ^2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package maarheeze/codegraph-laravel contains the following files

Loading the files please wait ...