PHPackages                             bfg/laravel-boost-reflector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. bfg/laravel-boost-reflector

ActiveLibrary[Templating &amp; Views](/categories/templating)

bfg/laravel-boost-reflector
===========================

Laravel boost with reflection of classes

v1.0.1(4mo ago)020MITPHPPHP ^8.1|^8.2

Since Nov 16Pushed 4mo agoCompare

[ Source](https://github.com/bfg-s/laravel-boost-reflector)[ Packagist](https://packagist.org/packages/bfg/laravel-boost-reflector)[ RSS](/packages/bfg-laravel-boost-reflector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Laravel Boost Reflector
=======================

[](#laravel-boost-reflector)

[![Latest Version](https://camo.githubusercontent.com/b82144db181072669abcc9968ad25fa518d5a483a85418cf73c379fd861f222b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6266672f6c61726176656c2d626f6f73742d7265666c6563746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bfg/laravel-boost-reflector)[![Total Downloads](https://camo.githubusercontent.com/6afe735d3e7ff5179641ff8424dc8db66c5d82805cdffe030609adb8a750b2ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6266672f6c61726176656c2d626f6f73742d7265666c6563746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bfg/laravel-boost-reflector)[![License](https://camo.githubusercontent.com/f29311fbf303d9615cb2716a8846b8552694a3c6aaa241a6f4fa2c204318544e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6266672f6c61726176656c2d626f6f73742d7265666c6563746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bfg/laravel-boost-reflector)

Laravel Boost Reflector extends the [Laravel Boost MCP server](https://github.com/laravel/boost) with powerful PHP class reflection and analysis capabilities. It provides three specialized tools for deep code introspection, enabling code analysis, documentation generation, refactoring planning, and architecture understanding.

Built on top of [Roave BetterReflection](https://github.com/Roave/BetterReflection), this package offers fast class discovery with advanced filtering, comprehensive API introspection including inherited members, and dependency usage analysis across your entire codebase—including vendor packages.

Whether you're exploring Laravel's Eloquent API, planning a major refactoring, generating documentation, or analyzing architectural dependencies, Laravel Boost Reflector provides the metadata you need with precision and performance.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require bfg/laravel-boost-reflector
```

The package will automatically register its MCP tools with Laravel Boost.

Available Tools
---------------

[](#available-tools)

ToolDescription**class-list**Fast discovery of PHP classes with powerful filtering by traits, interfaces, and methods**class-detail**Deep introspection of class structure including methods, properties, constants, and complete inheritance hierarchy**class-usages**Dependency analysis showing where and how classes are used throughout the codebaseUsage Examples
--------------

[](#usage-examples)

### class-list

[](#class-list)

Fast discovery of PHP classes with powerful filtering capabilities. Perfect for finding classes that match specific criteria like traits, interfaces, or methods.

**Find all Eloquent models with HasFactory trait:**

```
{
  "path": "app/Models",
  "has_trait": "Illuminate\\Database\\Eloquent\\Factories\\HasFactory"
}
```

**Find all controllers:**

```
{
  "path": "app/Http/Controllers",
  "recursive": true
}
```

**Find classes with boot() method:**

```
{
  "path": "app",
  "has_method": "boot",
  "limit": 20
}
```

**Example output structure:**

```
[
  {
    "file": "/path/to/app/Models/User.php",
    "name": "App\\Models\\User",
    "parent": "Illuminate\\Foundation\\Auth\\User",
    "interfaces": ["Illuminate\\Contracts\\Auth\\MustVerifyEmail"],
    "traits": [
      "Illuminate\\Database\\Eloquent\\Factories\\HasFactory",
      "Illuminate\\Notifications\\Notifiable"
    ],
    "docblock": "User model representing authenticated users"
  }
]
```

**Parameters:**

- `path` (required) - Directory to scan
- `has_trait` - Filter by trait (full namespace)
- `has_interface` - Filter by interface (full namespace)
- `has_method` - Filter by method name
- `recursive` - Scan subdirectories (default: true)
- `limit` - Maximum results to return
- `offset` - Skip first N results

**Use cases:**

- Find all Eloquent models with specific traits (SoftDeletes, HasFactory)
- Locate all controllers or middleware in your application
- Discover classes implementing specific interfaces (ShouldQueue, Responsable)
- Identify classes with specific methods for refactoring

---

### class-detail

[](#class-detail)

Deep introspection of any PHP class with complete API details. Returns comprehensive information about methods, properties, constants, parameters, return types, visibility, and docblocks.

**Explore Eloquent Model API (including inherited methods):**

```
{
  "class": "Illuminate\\Database\\Eloquent\\Model",
  "methods": true,
  "include_inherited": true,
  "visibility": "public",
  "methods_limit": 20
}
```

**Analyze a specific project class:**

```
{
  "class": "App\\Models\\User",
  "constants": true,
  "properties": true,
  "methods": true,
  "full_docblocks": true
}
```

**Quick overview with summary mode:**

```
{
  "class": "App\\Services\\PaymentService",
  "summary_mode": true
}
```

**Find all static helper methods:**

```
{
  "class": "Illuminate\\Support\\Str",
  "methods": true,
  "static_only": true,
  "visibility": "public"
}
```

**Example output structure:**

```
{
  "name": "App\\Models\\User",
  "file": "/path/to/app/Models/User.php",
  "parent": "Illuminate\\Foundation\\Auth\\User",
  "interfaces": ["Illuminate\\Contracts\\Auth\\MustVerifyEmail"],
  "traits": ["HasFactory", "Notifiable"],
  "methods": [
    {
      "name": "posts",
      "visibility": "public",
      "static": false,
      "return_type": "Illuminate\\Database\\Eloquent\\Relations\\HasMany",
      "parameters": [],
      "docblock": "Get all posts for the user"
    }
  ],
  "properties": [
    {
      "name": "fillable",
      "visibility": "protected",
      "type": "array",
      "default": ["name", "email", "password"]
    }
  ]
}
```

**Parameters:**

- `class` (required) - Full class namespace or file path
- `constants` - Include class constants (default: true)
- `properties` - Include properties (default: true)
- `methods` - Include methods (default: true)
- `include_inherited` - Show inherited members from parent classes (default: false)
- `visibility` - Filter by visibility: "public", "protected", "all" (default: "public")
- `static_only` - Show only static methods (default: false)
- `summary` - Show only summary lines in docblocks (default: true)
- `full_docblocks` - Show complete docblocks everywhere (default: false)
- `summary_mode` - Concise output for quick overview (default: false)
- `methods_limit`, `methods_offset` - Paginate methods
- `properties_limit`, `properties_offset` - Paginate properties
- `constants_limit`, `constants_offset` - Paginate constants

**Use cases:**

- Explore complete Eloquent Model API with all inherited methods
- Understand Laravel helper classes (Str, Arr, Collection)
- Generate API documentation from class metadata
- Analyze class structure before refactoring
- Discover available methods on vendor classes

---

### class-usages

[](#class-usages)

Comprehensive dependency and usage analysis showing where and how classes are used throughout your codebase. Essential for refactoring impact analysis and understanding dependencies.

**Find all usages of a specific class:**

```
{
  "target": "App\\Models\\User",
  "path": "app"
}
```

**Analyze Route facade usage:**

```
{
  "target": "Illuminate\\Support\\Facades\\Route",
  "usage_types": ["import", "static_call"],
  "group_by_type": true
}
```

**Refactoring impact analysis:**

```
{
  "target": "App\\Services\\PaymentService",
  "exclude_vendor": true,
  "group_by_type": true
}
```

**Find all classes extending a base class:**

```
{
  "target": "App\\Http\\Controllers\\Controller",
  "usage_types": ["extends"]
}
```

**Example output structure:**

```
{
  "target": "App\\Models\\User",
  "usages": [
    {
      "file": "/path/to/app/Http/Controllers/UserController.php",
      "line": 15,
      "type": "import",
      "context": "use App\\Models\\User;"
    },
    {
      "file": "/path/to/app/Http/Controllers/UserController.php",
      "line": 42,
      "type": "static_call",
      "context": "User::where('active', true)->get()"
    }
  ],
  "statistics": {
    "total_usages": 24,
    "by_type": {
      "import": 8,
      "static_call": 12,
      "new": 4
    },
    "by_file": {
      "/path/to/app/Http/Controllers/UserController.php": 5
    }
  },
  "scan_stats": {
    "files_scanned": 156,
    "scan_time_ms": 245
  }
}
```

**Parameters:**

- `target` (required) - Full class namespace to search for
- `path` - Directory to scan (default: "app")
- `usage_types` - Filter by types: "import", "new", "static\_call", "extends", "implements", "trait", "type\_hint"
- `exclude_vendor` - Skip vendor directory (default: true)
- `flush_cache` - Clear cached results before scanning (default: false)
- `group_by_type` - Group results by usage type (default: false)
- `sort_by` - Sort by: "line", "file", "type" (default: "line")
- `limit` - Maximum results (default: 100)
- `offset` - Skip first N results

**Use cases:**

- Refactoring impact analysis before changing a class
- Find all Route facade usages in your application
- Dead code detection (classes with zero usages)
- Understand dependency chains and coupling
- Track which classes extend or implement specific types

Common Use Cases
----------------

[](#common-use-cases)

### Architecture Analysis

[](#architecture-analysis)

Understand your application's structure by discovering all classes that implement specific interfaces or use particular traits:

```
{
  "path": "app",
  "has_interface": "Illuminate\\Contracts\\Queue\\ShouldQueue"
}
```

### Refactoring Planning

[](#refactoring-planning)

Before refactoring a class, analyze its usage to understand the impact:

```
{
  "target": "App\\Services\\LegacyService",
  "exclude_vendor": true,
  "group_by_type": true
}
```

### Documentation Generation

[](#documentation-generation)

Extract complete API information from classes to generate documentation:

```
{
  "class": "App\\Services\\ApiClient",
  "methods": true,
  "properties": true,
  "full_docblocks": true,
  "visibility": "public"
}
```

### Finding Models with Specific Traits

[](#finding-models-with-specific-traits)

Discover all Eloquent models using SoftDeletes or other traits:

```
{
  "path": "app/Models",
  "has_trait": "Illuminate\\Database\\Eloquent\\SoftDeletes"
}
```

### Laravel API Exploration

[](#laravel-api-exploration)

Learn what methods are available on Laravel's core classes, including inherited methods:

```
{
  "class": "Illuminate\\Support\\Collection",
  "methods": true,
  "include_inherited": true,
  "visibility": "public",
  "static_only": false
}
```

### Dead Code Detection

[](#dead-code-detection)

Find classes that are never used in your codebase:

```
{
  "target": "App\\Services\\UnusedService",
  "path": "app"
}
```

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel Boost ^1.8

Credits
-------

[](#credits)

- [Xsaven](https://github.com/bfg-s)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance74

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Total

2

Last Release

144d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59b2d162a30938ac2c3c56340ebea07a6778a3e1c86cb70b5bc28b69a1c3f04d?d=identicon)[bfg](/maintainers/bfg)

---

Top Contributors

[![Xsaven](https://avatars.githubusercontent.com/u/1726771?v=4)](https://github.com/Xsaven "Xsaven (5 commits)")

---

Tags

phplaraveltemplate

### Embed Badge

![Health badge](/badges/bfg-laravel-boost-reflector/health.svg)

```
[![Health](https://phpackages.com/badges/bfg-laravel-boost-reflector/health.svg)](https://phpackages.com/packages/bfg-laravel-boost-reflector)
```

###  Alternatives

[tomatophp/filament-wallet

Account Balance / Wallets Manager For FilamentPHP and Filament Account Builder

3528.5k2](/packages/tomatophp-filament-wallet)[tomatophp/filament-subscriptions

Manage subscriptions and feature access with customizable plans in FilamentPHP

628.1k](/packages/tomatophp-filament-subscriptions)[tomatophp/filament-plugins

Manage your modules as a plugin system with plugin generator

644.7k2](/packages/tomatophp-filament-plugins)[tomatophp/filament-docs

Manage your documents and contracts all in one place with template builder

422.6k](/packages/tomatophp-filament-docs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
