PHPackages                             alizharb/laravel-modular-livewire - 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. [Framework](/categories/framework)
4. /
5. alizharb/laravel-modular-livewire

ActiveLibrary[Framework](/categories/framework)

alizharb/laravel-modular-livewire
=================================

The official Livewire bridge for Laravel Modular offering automatic discovery and registration of modular Livewire components.

v1.0.2(3mo ago)227MITPHPPHP ^8.2CI passing

Since Jan 24Pushed 3mo agoCompare

[ Source](https://github.com/AlizHarb/laravel-modular-livewire)[ Packagist](https://packagist.org/packages/alizharb/laravel-modular-livewire)[ GitHub Sponsors](https://github.com/alizharb)[ RSS](/packages/alizharb-laravel-modular-livewire/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (10)Versions (4)Used By (0)

Laravel Modular Livewire ⚡
==========================

[](#laravel-modular-livewire-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fdd2e47a018dcdadd859013a7b6dd52e073587d66ccd21d8fe320837131c006b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c697a686172622f6c61726176656c2d6d6f64756c61722d6c697665776972652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alizharb/laravel-modular-livewire)[![GitHub Tests Action Status](https://camo.githubusercontent.com/59966122eaaf0252bc269f1082d430445c4974d184d8256afd9888cab1602b4b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c697a686172622f6c61726176656c2d6d6f64756c61722d6c697665776972652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/alizharb/laravel-modular-livewire/actions)[![Total Downloads](https://camo.githubusercontent.com/ebf6dd94c423fac00b9457f05df8ef7564e6fa3f685e2a8c1d7f7fb58d5aa271/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c697a686172622f6c61726176656c2d6d6f64756c61722d6c697665776972652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alizharb/laravel-modular-livewire)[![License](https://camo.githubusercontent.com/1918b06fecb731ba266f618ed5c9d07783cd6dcd20f5e9d381bb26ae83e46a91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616c697a686172622f6c61726176656c2d6d6f64756c61722d6c697665776972652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

**Laravel Modular Livewire** is the official bridge for [Laravel Modular](https://github.com/alizharb/laravel-modular). It enables automatic discovery, registration, and first-class Artisan support for Livewire components within your modular architecture.

✨ Features
----------

[](#-features)

- 🔍 **Automatic Discovery**: Automatically scans and registers Livewire components in `Modules/*/app/Livewire`.
- 🏗️ **Modular Artisan Command**: Enhanced `make:livewire` command with `--module` support.
- 🎨 **Namespace Isolation**: Components are automatically prefixed with the module name (e.g., ``).
- ⚡ **Performance Optimized**: Intelligent component caching for zero-overhead in production.
- ✅ **Strictly Typed**: Fully compatible with PHPStan level 5 (and scalable to level 9).

🚀 Installation
--------------

[](#-installation)

Install the package via Composer (requires `alizharb/laravel-modular`):

```
composer require alizharb/laravel-modular-livewire
```

The service provider will be automatically registered. It will automatically hook into the `laravel-modular` registry.

---

📖 Usage
-------

[](#-usage)

### Generating Modular Components

[](#generating-modular-components)

Use the native `make:livewire` command with the `--module` flag to generate any Livewire 4 component type.

#### 1. Single-File Components (Default)

[](#1-single-file-components-default)

The modern Livewire 4 standard. Everything in one `.blade.php` file.

```
php artisan make:livewire Status --module=Blog
```

- **Creates**: `Modules/Blog/resources/views/livewire/⚡status.blade.php`
- **Identifier**: `blog::status`

#### 2. Class-Based Components

[](#2-class-based-components)

The traditional separate Class and Template structure.

```
php artisan make:livewire Analytics --module=Blog --class
```

- **Class**: `Modules/Blog/app/Livewire/Analytics.php`
- **View**: `Modules/Blog/resources/views/livewire/analytics.blade.php`

#### 3. Multi-File Components (MFC)

[](#3-multi-file-components-mfc)

Perfect for complex components with dedicated JS and CSS.

```
php artisan make:livewire Dashboard --module=Blog --mfc
```

- **Creates**: `Modules/Blog/resources/views/livewire/⚡dashboard/` (Directory containing `.php`, `.blade.php`, `.js`, `.css`)

#### 4. Page Components (Preferred for Routing)

[](#4-page-components-preferred-for-routing)

Use the `pages::` prefix for full-page components to keep them logically separated from UI fragments.

```
php artisan make:livewire pages::post.create --module=Blog
```

- **Creates**: `Modules/Blog/resources/views/livewire/pages/⚡create.blade.php`
- **Identifier**: `blog::pages::post.create`

### Routing (Livewire 4)

[](#routing-livewire-4)

Laravel Modular Livewire fully supports Livewire 4's native `Route::livewire()` for full-page modular components.

#### Using Class-based Routes

[](#using-class-based-routes)

```
use Modules\Blog\Livewire\Analytics;
use Illuminate\Support\Facades\Route;

Route::livewire('/blog/analytics', Analytics::class);
```

#### Using Modular Aliases

[](#using-modular-aliases)

```
// Resolves to the single-file or class-based component
Route::livewire('/blog/status', 'blog::status');

// Full-page component via modular alias
Route::livewire('/blog/create', 'blog::pages::post.create');

// Example from Test module
Route::livewire('/blog/create', 'blog::pages::post.create');
```

### Using Components in Blade

[](#using-components-in-blade)

In your Blade views, use the module's alias as the namespace:

```
{{-- Traditional or Single-file --}}

{{-- Specialized Page Components --}}

{{-- Example from Blog module --}}

```

---

⚙️ Configuration
----------------

[](#️-configuration)

The bridge respects your existing `modular.php` paths and Livewire's own configuration. No additional configuration is required.

---

📦 Related Packages
------------------

[](#-related-packages)

Explore the rest of the **Laravel Modular** ecosystem:

- [Laravel Modular](https://github.com/alizharb/laravel-modular) - The core modular system.
- [Laravel Modular Filament](https://github.com/alizharb/laravel-modular-filament) - Filament integration for modular applications.
- [Laravel Hooks](https://github.com/alizharb/laravel-hooks) - Event-driven hooks for modular communication.
- [Laravel Themer](https://github.com/alizharb/laravel-themer) - Theme management for modular applications.

---

🧪 Testing
---------

[](#-testing)

```
vendor/bin/pest
```

---

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING](https://github.com/alizharb/laravel-modular/blob/main/.github/CONTRIBUTING.md) for details.

📄 License
---------

[](#-license)

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

---

 Made with ❤️ by **Ali Harb**

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance80

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

3

Last Release

105d ago

### Community

Maintainers

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

---

Top Contributors

[![AlizHarb](https://avatars.githubusercontent.com/u/34816428?v=4)](https://github.com/AlizHarb "AlizHarb (3 commits)")

---

Tags

laravellivewiremodulesmodularlaravel-modularautomatic-discoveryartisan-overrides

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alizharb-laravel-modular-livewire/health.svg)

```
[![Health](https://phpackages.com/badges/alizharb-laravel-modular-livewire/health.svg)](https://phpackages.com/packages/alizharb-laravel-modular-livewire)
```

###  Alternatives

[mhmiton/laravel-modules-livewire

Using Laravel Livewire in Laravel Modules package with automatically registered livewire components for every modules.

236409.6k9](/packages/mhmiton-laravel-modules-livewire)[internachi/modular

Modularize your Laravel apps

1.1k662.4k8](/packages/internachi-modular)[artem-schander/l5-modular

Modular pattern generator for Laravel

223235.5k](/packages/artem-schander-l5-modular)

PHPackages © 2026

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