livewire / livewire/volt

Volt components do not support namespacing, causing conflicts across modules with same component names

Open
#137 7 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
423
Forks
36
PR merge metrics
No merged PRs in 30d

Description

### Volt Version

1.7

### Laravel Version

12

### PHP Version

8.4

### Database Driver & Version

_No response_

### Description

In my Laravel project, I follow a modular structure where each module can have its own set of Livewire components. It’s common for different modules to have components with the same name (e.g., Button), and Livewire allows for namespacing to prevent conflicts:

```php
class Button extends Component
{
public function render()
{
return view('somemodule::livewire.button');
}
}
```

Then in the Blade view, I can use:

```php

```

This works perfectly and avoids naming collisions.

However, when using Volt components, the `render() `method is not defined, and as a result, I cannot specify a view path or namespace. Volt components are always referenced like:

```php

```

If multiple Volt components with the same name exist across different modules, one of them overwrites the others. This makes it impossible to use the same component name in different modules when using Volt.

### Steps To Reproduce

1. Create a Laravel modular project structure.
2. In ModuleA, create a Volt component named Button.
3. In ModuleB, create another Volt component also named Button.
4. Attempt to reference both components in a Blade file (components will not be found):

```php

```

5. Observe that only one of the components is registered and used, due to lack of namespacing in Volt.

```php

```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue describes Volt components and namespaced Livewire/Blade tags but names no files or tests. Start by tracing how Volt registers components and how Livewire resolves namespaced tags; done means two same-named components can be referenced independently without one overwriting the other.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.