Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Modular Laravel Package

internachi/modular

A lightweight module system for Laravel apps using Composer path repositories and Laravel package discovery. Create self-contained modules in an app-modules/ directory, following standard Laravel package conventions with minimal extra tooling.

View on GitHub
Deep Wiki
Context7
3.0.2

What's Changed

New Contributors

Full Changelog: https://github.com/InterNACHI/modular/compare/3.0.1...3.0.2

3.0.0

Modular 3.0 is a mostly backwards-compatible rewrite of much of the modular core.

Plugin-Based Architecture

Modular 3.0 introduces a plugin-based architecture that replaces the monolithic service provider with focused, composable plugin classes. This architectural refactoring improves extensibility, testability, and separation of concerns.

Built-in Plugins

Each aspect of module auto-discovery is now handled by a dedicated plugin:

Plugin Responsibility
ModulesPlugin Discovers composer.json files and creates ModuleConfig instances
RoutesPlugin Loads route files from modules
ViewPlugin Registers view namespaces
BladePlugin Registers Blade components with module namespaces
TranslatorPlugin Registers translation namespaces and JSON paths
EventsPlugin Discovers and registers event listeners
MigratorPlugin Registers migration paths
GatePlugin Auto-registers model policies
ArtisanPlugin Registers console commands

Registering Custom Plugins

Third-party packages or application code can register custom plugins:

use InterNACHI\Modular\PluginRegistry;

PluginRegistry::register(MyCustomPlugin::class);

Custom plugins will be automatically integrated into the caching system and can use the attribute-based lifecycle controls.

Plugin Lifecycle

Each plugin implements a two-phase lifecycle:

  1. discover() - Scans the filesystem and returns serializable discovery data
  2. handle() - Processes the discovered data (registers with Laravel services)

PHP 8 attributes control when plugins execute:

use InterNACHI\Modular\Plugins\Attributes\AfterResolving;

#[AfterResolving(BladeCompiler::class)]
class BladePlugin extends Plugin
{
    // Only runs when BladeCompiler is resolved
}

Unified Caching

The modules:cache command now caches all plugin discovery data in a single file (bootstrap/cache/app-modules.php). This simplifies cache invalidation and reduces filesystem operations during bootstrapping.

Laravel 11+ & PHP 8.3+

Modular 3.0 requires Laravel 11 or later and PHP 8.3 or later. This allows us to leverage modern PHP features like attributes and constructor property promotion throughout the codebase.

Streamlined Dependencies

The Livewire integration has been moved to a separate package to keep the core package focused and reduce dependencies.

Breaking Changes

Please see the Upgrade Guide for a complete list of breaking changes and migration instructions.

Full Changelog: https://github.com/InterNACHI/modular/compare/2.3.0...3.0.0

3.0.0-beta.1

Modular 3.0 is a mostly backwards-compatible rewrite of much of the modular core.

Plugin-Based Architecture

Modular 3.0 introduces a plugin-based architecture that replaces the monolithic service provider with focused, composable plugin classes. This architectural refactoring improves extensibility, testability, and separation of concerns.

Built-in Plugins

Each aspect of module auto-discovery is now handled by a dedicated plugin:

Plugin Responsibility
ModulesPlugin Discovers composer.json files and creates ModuleConfig instances
RoutesPlugin Loads route files from modules
ViewPlugin Registers view namespaces
BladePlugin Registers Blade components with module namespaces
TranslatorPlugin Registers translation namespaces and JSON paths
EventsPlugin Discovers and registers event listeners
MigratorPlugin Registers migration paths
GatePlugin Auto-registers model policies
ArtisanPlugin Registers console commands

Registering Custom Plugins

Third-party packages or application code can register custom plugins:

use InterNACHI\Modular\PluginRegistry;

PluginRegistry::register(MyCustomPlugin::class);

Custom plugins will be automatically integrated into the caching system and can use the attribute-based lifecycle controls.

Plugin Lifecycle

Each plugin implements a two-phase lifecycle:

  1. discover() - Scans the filesystem and returns serializable discovery data
  2. handle() - Processes the discovered data (registers with Laravel services)

PHP 8 attributes control when plugins execute:

use InterNACHI\Modular\Plugins\Attributes\AfterResolving;

#[AfterResolving(BladeCompiler::class)]
class BladePlugin extends Plugin
{
    // Only runs when BladeCompiler is resolved
}

Unified Caching

The modules:cache command now caches all plugin discovery data in a single file (bootstrap/cache/app-modules.php). This simplifies cache invalidation and reduces filesystem operations during bootstrapping.

Laravel 11+ & PHP 8.3+

Modular 3.0 requires Laravel 11 or later and PHP 8.3 or later. This allows us to leverage modern PHP features like attributes and constructor property promotion throughout the codebase.

Streamlined Dependencies

The Livewire integration has been moved to a separate package to keep the core package focused and reduce dependencies.

Breaking Changes

Please see the Upgrade Guide for a complete list of breaking changes and migration instructions.

New Contributors

Full Changelog: https://github.com/InterNACHI/modular/compare/2.2.1...3.0.0-beta.1

3.0.0-alpha.2

Moved Modularize helper trait to separate package.

Full Changelog: https://github.com/InterNACHI/modular/compare/3.0.0-alpha.1...3.0.0-alpha.2

3.0.0-alpha.1

Modular 3.0 is a mostly backwards-compatible rewrite of much of the modular core.

Plugin-Based Architecture

Modular 3.0 introduces a plugin-based architecture that replaces the monolithic service provider with focused, composable plugin classes. This architectural refactoring improves extensibility, testability, and separation of concerns.

Built-in Plugins

Each aspect of module auto-discovery is now handled by a dedicated plugin:

Plugin Responsibility
ModulesPlugin Discovers composer.json files and creates ModuleConfig instances
RoutesPlugin Loads route files from modules
ViewPlugin Registers view namespaces
BladePlugin Registers Blade components with module namespaces
TranslatorPlugin Registers translation namespaces and JSON paths
EventsPlugin Discovers and registers event listeners
MigratorPlugin Registers migration paths
GatePlugin Auto-registers model policies
ArtisanPlugin Registers console commands

Registering Custom Plugins

Third-party packages or application code can register custom plugins:

use InterNACHI\Modular\PluginRegistry;

PluginRegistry::register(MyCustomPlugin::class);

Custom plugins will be automatically integrated into the caching system and can use the attribute-based lifecycle controls.

Plugin Lifecycle

Each plugin implements a two-phase lifecycle:

  1. discover() - Scans the filesystem and returns serializable discovery data
  2. handle() - Processes the discovered data (registers with Laravel services)

PHP 8 attributes control when plugins execute:

use InterNACHI\Modular\Plugins\Attributes\AfterResolving;

#[AfterResolving(BladeCompiler::class)]
class BladePlugin extends Plugin
{
    // Only runs when BladeCompiler is resolved
}

Unified Caching

The modules:cache command now caches all plugin discovery data in a single file (bootstrap/cache/app-modules.php). This simplifies cache invalidation and reduces filesystem operations during bootstrapping.

Laravel 11+ & PHP 8.3+

Modular 3.0 requires Laravel 11 or later and PHP 8.3 or later. This allows us to leverage modern PHP features like attributes and constructor property promotion throughout the codebase.

Streamlined Dependencies

The Livewire integration has been moved to a separate package to keep the core package focused and reduce dependencies.

Breaking Changes

Please see the Upgrade Guide for a complete list of breaking changes and migration instructions.

Full Changelog: https://github.com/InterNACHI/modular/compare/2.3.0...3.0.0-alpha.1

2.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/InterNACHI/modular/compare/2.2.1...2.3.0

2.2.1

What's Changed

New Contributors

Full Changelog: https://github.com/InterNACHI/modular/compare/2.2.0...2.3.0

2.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/InterNACHI/modular/compare/2.1.0...2.2.0

2.1.0

[!note] This will be the last version to support Laravel 9 and PHP 8.0.

What's Changed

New Contributors

Full Changelog: https://github.com/InterNACHI/modular/compare/2.0.0...2.1.0

2.0.0

Note The 2.0.0 and 1.12.0 releases are functionally the same. The only changes are in composer version constraints, removing code that was specific to Laravel 7, and a handful of refactors to PHP 8 language features.

Changed

  • Dropped support for older versions of PHP and Laravel. If you are using Laravel 7 or 8, or PHP 7, please use the 1.x release.
1.12.0

Added

  • Added support for factory model name resolution inside modules

Fixed

  • Added support for new make:command changes in Laravel 10
1.11.0

Changed

  • Updated version constraints to add Laravel 10 support and drop automated testing for old versions of PHP and Laravel

Full Changelog: https://github.com/InterNACHI/modular/compare/1.10.0...1.11.0

1.10.0

Fixed

  • Improved path normalization on Windows (thanks to @Sophist-UK)
1.9.0

Fixed

  • Addressed issue where make:migration and make:livewire were not loading the custom --module option
  • Added additional tests for make: commands to catch necessary changes quicker in the future
  • Passing a --module flag for an unknown module now triggers a console error
1.8.0

Added

  • Added support for Blade component namespaces (i.e. <x-module::component.name />)

Fixed

  • Fixed issue with make:seeder command introduced in Laravel 9.6.0
1.7.0

Added

  • Added support for Laravel 9.x
1.6.0

Added

  • Added support for custom module stubs

Fixed

  • Only register the make:livewire integration if Livewire is installed
1.5.2

Added support for PhpStorm's workspace.xml to the sync command and updated a test to match recent Laravel 8.0 changes.

1.5.1

Added

  • Added support for make:cast
1.5.0

Added

  • Added support for Livewire's make:livewire command
1.4.0

Added

  • Added support for --module in php artisan db:seed

Fixed

  • Create seeders in the correct namespace when --module flag is used in Laravel 8+
  • Create factories in the correct namespace when --module flag is used in Laravel 8+
  • Apply module namespace to models when creating a factory in a module
1.3.1

Fixed

  • Added better handling of missing directories
1.3.0

Added

  • Added support for translations in modules

Changed

  • Switched to diglactic/laravel-breadcrumbs for breadcrumbs check
1.2.2

Added

  • Added better patching for PHPStorm config files to minimize diffs
1.2.1

Sort routes by name by default.

1.2.0

Added

  • Support for auto-registering Laravel 8 factory classes

Fixed

  • Better Windows support
  • Support for composer 2.0
  • Improves the file scanning efficiency of the AutoDiscoveryHelper
1.1.1

Adds a fix for Windows directory separators.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport