PHPackages                             forxer/blade-components-ide-helper - 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. forxer/blade-components-ide-helper

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

forxer/blade-components-ide-helper
==================================

Generate IDE metadata (VS Code snippets &amp; Custom Data, PhpStorm ide.json) for Laravel packages that ship class-based Blade components.

2.0.0(1mo ago)044↑75%1MITPHPPHP ^8.4

Since Jun 28Pushed 1mo agoCompare

[ Source](https://github.com/forxer/blade-components-ide-helper)[ Packagist](https://packagist.org/packages/forxer/blade-components-ide-helper)[ RSS](/packages/forxer-blade-components-ide-helper/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (4)Dependencies (13)Versions (6)Used By (1)

Blade Components IDE Helper
===========================

[](#blade-components-ide-helper)

Generate IDE metadata for Laravel packages (and apps) that ship **class-based Blade components**:

- **VS Code Custom Data** (`.html-data.json`) — full attribute-name/value completion and hover inside `` tags, via the **[Blade Components IDE Helper](https://marketplace.visualstudio.com/items?itemName=forxer.blade-components-ide-helper)**VS Code extension (also on [Open VSX](https://open-vsx.org/extension/forxer/blade-components-ide-helper)). **This is the recommended solution.**
- **VS Code snippets** (`.code-snippets`) — zero-install *fallback* that scaffolds `` tags without any extension. Use it only when the extension can't be installed.
- **PhpStorm / Laravel Idea** (`ide.json`) — tag → component-class mapping, auto-merged by Laravel Idea.

> **Pick one VS Code output, not both.** The snippets and the extension both complete ``, and when generated together the snippets outrank the extension's suggestions. If your team uses the extension, generate `--json --ide-json` (skip `--snippets`); otherwise generate `--snippets --ide-json`. The `ide.json` (PhpStorm) is independent — keep it in either case.

It is a small, framework-only library: you describe your components with a `ComponentDefinition`, and either extend the provided `AbstractIdeCommand` or call the services directly.

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

[](#installation)

```
composer require --dev forxer/blade-components-ide-helper
```

This package is a **dev tool** — require it with `--dev`. If your package hydrates component properties at render time, do not require this one at runtime: require [`forxer/blade-components-reflection`](https://packagist.org/packages/forxer/blade-components-reflection)instead, which ships the `AttributeReflector` used both at runtime and by this generator.

The contract: `ComponentDefinition`
-----------------------------------

[](#the-contract-componentdefinition)

```
use Forxer\BladeComponentsIdeHelper\Definition\ComponentDefinition;

$definition = new ComponentDefinition(
    components: ['alert' => Alert::class, 'badge' => Badge::class], // alias => class
    prefix: '',                                                     //  vs
    // attributeSurface: ...   (see below — defaults to constructor parameters)
    // slotStrategy: ...       (see below — defaults to view scanning)
    // snippetValueAttributes: ['variant'],  // which attribute gets a value dropdown in snippets
);
```

### Attribute surfaces — what counts as a settable attribute

[](#attribute-surfaces--what-counts-as-a-settable-attribute)

- `ConstructorParametersSurface` (default): constructor parameters only. Correct for a standard Illuminate component, whose settable attributes are exactly its constructor parameters.
- `PropertiesAndConstructorSurface`: the union of public settable properties **and** constructor parameters. Use it when your components hydrate public properties in addition to constructor arguments.

Both read descriptions and constrained value sets from docblocks: a property's summary and its `@var 'a'|'b'` literal union, or a constructor parameter's `@param` summary.

You can supply your own by implementing `Forxer\BladeComponentsIdeHelper\Attributes\AttributeSurface`.

### Slot strategies — does the component accept inner content?

[](#slot-strategies--does-the-component-accept-inner-content)

- `ViewScanningSlotStrategy` (default): instantiates the component with dummy arguments, calls `render()`, and scans the resolved view (file or inline string) for `$slot`. Any failure degrades to "no slot" (self-closing snippet).
- `NullSlotStrategy`: always reports no slot.

Implement `Forxer\BladeComponentsIdeHelper\Slots\SlotStrategy` for a custom rule.

Wiring a command
----------------

[](#wiring-a-command)

Describe your components once as an `IdeTarget` (a `ComponentDefinition` plus the file base name), in your service provider. Register it with the `IdeTargetRegistry` so the aggregate command can find it, and expose a thin per-package command whose `target()` returns that same target.

```
use Forxer\BladeComponentsIdeHelper\Attributes\PropertiesAndConstructorSurface;
use Forxer\BladeComponentsIdeHelper\Definition\ComponentDefinition;
use Forxer\BladeComponentsIdeHelper\Definition\IdeTarget;
use Forxer\BladeComponentsIdeHelper\Registry\IdeTargetRegistry;

// In your service provider — the single source of truth for the target:
public static function ideTarget(): IdeTarget
{
    return new IdeTarget(
        definition: new ComponentDefinition(
            components: config('my-package.components'),
            prefix: (string) config('my-package.prefix', ''),
            attributeSurface: new PropertiesAndConstructorSurface(),
        ),
        fileBaseName: 'my-package',
    );
}

public function boot(): void
{
    // so `blade-components-ide-helper:generate` regenerates this package too:
    IdeTargetRegistry::register(self::ideTarget());
    $this->commands([IdeCommand::class]);
}
```

```
use Forxer\BladeComponentsIdeHelper\Commands\AbstractIdeCommand;
use Forxer\BladeComponentsIdeHelper\Definition\IdeTarget;

class IdeCommand extends AbstractIdeCommand
{
    protected $signature = 'my-package:ide
        {--output= : Output directory for the VS Code files (default: .vscode)}
        {--ide-output= : Output directory for ide.json}
        {--snippets : Generate the VS Code snippets file}
        {--json : Generate the VS Code Custom Data file}
        {--ide-json : Generate the PhpStorm/Laravel Idea ide.json file}';

    protected $description = 'Generate IDE metadata for the components';

    protected function target(): IdeTarget
    {
        return MyServiceProvider::ideTarget();
    }
}
```

Running `php artisan my-package:ide` writes `.vscode/my-package.code-snippets`, `.vscode/my-package.html-data.json`, and `ide-helper/my-package/ide.json`.

Regenerating every consumer at once
-----------------------------------

[](#regenerating-every-consumer-at-once)

The package auto-registers an aggregate command. Once each consumer has registered its target, `php artisan blade-components-ide-helper:generate` regenerates the metadata of **every** registered package in a single run — pass `--only=base1,base2` to restrict it, plus the usual `--snippets` / `--json` / `--ide-json` format flags. A host application can then wire one `post-autoload-dump` line instead of one per consumer.

Multiple packages side by side
------------------------------

[](#multiple-packages-side-by-side)

Each consumer writes files under its own base name, so several packages coexist without collision: VS Code loads every `*.code-snippets`, and Laravel Idea recursively merges every `ide.json`. The `ide.json` is written to a package-owned subfolder (`ide-helper//`), never the shared project root and never `.vscode/`.

License
-------

[](#license)

MIT

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance91

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

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 ~1 days

Total

4

Last Release

41d ago

Major Versions

1.0.0 → 2.0.02026-07-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/aa033b458252f6496cc81308d72b97fcd3412545e50bb2017593eacff939771b?d=identicon)[forxer](/maintainers/forxer)

---

Top Contributors

[![forxer](https://avatars.githubusercontent.com/u/407917?v=4)](https://github.com/forxer "forxer (42 commits)")

---

Tags

autocompletebladecomponentsidelaravelphpstormvscode

###  Code Quality

TestsPest

Static AnalysisRector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/forxer-blade-components-ide-helper/health.svg)

```
[![Health](https://phpackages.com/badges/forxer-blade-components-ide-helper/health.svg)](https://phpackages.com/packages/forxer-blade-components-ide-helper)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

137236.2k8](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21327.3k4](/packages/ecotone-laravel)

PHPackages © 2026

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