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

Laravel Modular Laravel Package

alizharb/laravel-modular

View on GitHub
Deep Wiki
Context7
v1.1.5

This release introduces massive architectural upgrades to flawlessly align custom modular setups with native Laravel framework expectations, resolving deep historical friction points.

๐Ÿš€ Native Laravel Integrations

  • Class-Based Blade Components: Registered Blade::componentNamespace to enable auto-discovery. Class components in your module's app/View/Components/ directory now seamlessly render natively via <x-module::component>.
  • Eloquent Factory Resolution: Intercepted Laravel's Factory::guessFactoryNamesUsing() mapping behind the scenes. Native factory resolution is now supported for modular models (Product::factory()->create()) without pathing conflicts.
  • Dynamic Route Prefixing: Added the optional route_prefix string to module.json. web.php and api.php module routes will now automatically and natively dynamically wrap under this nested prefix when registered.

โš™๏ธ Core Architecture

  • Topological Boot Sorting: Replaced arbitrary file loading constraints with Kahn's directed graph algorithm. ModuleRegistry now guarantees modules boot in strict dependency order (via requires arrays) to entirely prevent race conditions and boot crashes.
  • Per-Module Generator Scaffolding: All generator commands (make:*) now natively parse a module's internal stubs/ directory first. This allows developers to completely isolate and override Laravel framework scaffolding natively on a strict per-module basis.

๐Ÿ”’ Action & Maintenance

  • Laravel 13 Testing Matrix: CI Pipelines upgraded and verified to support testing Laravel 13 dependencies safely.
  • Documentation: Overhauled laravel-modular/docs directory inserting comprehensive architectural diagrams, routing specifics, and component mappings directly into the developer site.

This release represents a profound stabilization layer specifically addressing large-scale monorepo component isolation and strict dependency reliability.

v1.1.4

v1.1.4 โ€” Workflow Automation & Architectural Integrity

This release focuses on hardening the modular architecture and streamlining the developer experience, particularly for large teams and high-performance applications.

๐Ÿš€ Key Improvements

๐Ÿ—๏ธ Git-Ready Module Workflows

New modules generated via php artisan make:module now automatically include .gitignore and .gitattributes. This encourages a "Module-as-a-Package" mindset, making it easier to manage modules as independent units or prepare them for extraction into standalone repositories.

๐Ÿ›ก๏ธ Inter-Module Dependency Enforcement

The module:enable command is now "dependency-aware." It recursively verifies that any dependencies defined in a module's module.json are also enabled. This prevents runtime "Service Not Found" errors by ensuring the dependency tree is healthy during activation.

โšก๏ธ Integrated Activation Caching

Module activation statuses are now part of the global modular cache. By running php artisan modular:cache, activation flags are moved from the filesystem into the bootstrap-level cache, significantly reducing I/O overhead during the application boot cycle.

๐Ÿฉบ Advanced Diagnostic Suite (modular:doctor)

We've significantly upgraded the modular:doctor command to help you maintain a clean codebase. It now detects:

  • Ghost Modules: Directories in the modules path missing valid metadata.
  • Duplicate Providers: Conflicting service provider registrations across different modules.
  • Asset Integrity: Verifying required public symlinks and directory structures.

๐Ÿ“ฆ Full Changelog

๐ŸŸข Added

  • Enhanced make:module: Automatic generation of .gitignore and .gitattributes.
  • Dependency Guard: Recursive verification of module dependencies during activation.
  • Activation Caching: Integration of status flags into the modular cache system.
  • New Diagnostics: Added checks for ghost modules, duplicate providers, and asset linking to modular:doctor.
  • PHP 8.4 & 8.5 Support: Full compatibility verification with upcoming PHP versions.
  • Test Script Automation: modular:install now configures the root composer.json to run module suites in isolation.

๐ŸŸก Changed

  • Isolated Testing: modular:test now sequentially executes tests in dedicated environments.
  • Standardized Config: Harmonized pint.json and dev-dependencies across the ecosystem.
  • Transparent Registry: Improved resource discovery tracking and lazy-loading performance.

โš™๏ธ Installation & Update

Update your package via Composer:

composer update alizharb/laravel-modular

After updating, it is recommended to run the doctor to verify your environment:

php artisan modular:doctor
v1.1.3

This release introduces critical safety features for module management and a complete visual overhaul of the documentation site.

๐Ÿš€ New Features

  • Safe Uninstallation: Introduced the module:uninstall {module} command. It safely removes modules and automatically handles cache clearing, ensuring a clean state.
  • Metadata Controls: Added granular control flags to module.json:
    • removable: Protects core/system modules from accidental uninstallation via CLI (default: true).
    • disableable: Prevents critical modules from being disabled (default: true).
  • Enhanced Documentation: A completely redesigned documentation experience:
    • ๐Ÿ“ฑ Mobile Support: Fully responsive layout with off-canvas sidebar and overlay.
    • ๐ŸŒ™ Dark/Light Mode: Optimized reading experience for all environments.
    • ๐Ÿ” Instant Search: Robust client-side search (Fuse.js) with crash prevention.
    • ๐Ÿ“š Ecosystem Guide: Comprehensive list of official integrations and launchers.

๐Ÿ›ก๏ธ Security & Stability

  • Command Guard: The module:disable command now strictly respects the disableable metadata flag, preventing accidental shutdowns of vital services.
  • Stability: Fixed documentation search crashes and ensured correct sidebar rendering on all devices.

๐Ÿ› ๏ธ Maintenance

  • Updated module stubs to include removable and disableable fields by default.
  • Improved schema validation in ModuleRegistry.
1.1.2

What's Changed

๐Ÿ“ฆ Assets & NPM Workspaces

  • Monorepo-lite Management: Each module now features its own package.json and vite.config.js for isolated dependency control.
  • NPM Workspaces: Automatically configures the root package.json to recognize modules, enabling efficient dependency hoisting.
  • New modular:npm Command: Manage module-level assets directly from Artisan (e.g., php artisan modular:npm Blog install).
  • Dynamic Vite Loader: Enhanced vite.modular.js now dynamically absorbs configuration from each module for a unified build process.

โšก Performance & Autoloading

  • Optimized PSR-4 Autoloading: The modular:install command now automates high-performance class loading for the Modules\ namespace.
  • New modular:sync Command: Easily flatten module-specific dependencies into the root composer.json for production optimization.

๐Ÿ” Discovery & Transparency

  • New modular:list Command: Visualize all registered modules and discovered resources (Policies, Events) along with their registration source.
  • Discovery Tracking: ModuleRegistry now tracks whether resources were found via convention or explicit configuration.

๐Ÿ›ก๏ธ CI & Stability

  • PHPStan Optimized: Resolved redundant null coalescing and method signature issues for 100% green builds.
  • Secret Protection: Removed hardcoded secrets from stubs and automated safe key generation for module tests.

Full Changelog: https://github.com/AlizHarb/laravel-modular/compare/v1.1.1...v1.1.2

v1.1.1

๐Ÿš€ Enhanced Vite Support & Setup Experience

This release refines the installation process for greater control and significantly improves how Vite discovers assets in modular applications.

โœจ Features

  • Independent Vite Loader: Introduced vite.modular.js for clean, standalone asset discovery in modules/. The new modularLoader helper simplifies vite.config.js configuration.
  • Interactive Installation: The modular:install command now respects your existing setup, prompting for confirmation before modifying composer.json or vite.config.js.
  • Manual Configuration Guide: Added comprehensive instructions in the README for developers who prefer manual package setup.
  • Ecosystem Promotion: Added dedicated section highlighting official integrations: Hooks, Filament, Livewire, and Themer.

๐Ÿ› Fixes

  • Module Stubs: Fixed an incorrect namespace segment (app) in the Service Provider stub for new modules.
  • Test Infrastructure: Optimized phpunit.xml and phpstan.neon for more reliable local package verification.

๐Ÿ’Ž Quality & Maintenance

  • Strict Typing: Resolved all static analysis issues, ensuring a 100% PHPStan-compliant codebase.
  • Standardized Style: Applied Laravel Pint formatting across all 71+ source files.
  • Robust Testing: Added ModularInstallCommandTest to verify installation workflows programmatically.
  • Better Discovery: Added suggested packages to composer.json to help developers find official modular extensions.
v1.1.0

๐Ÿš€ v1.1.0 Release Notes

This upgrade transforms Laravel Modular into a high-performance, production-ready framework with zero-overhead discovery and advanced dependency safeguards.

โšก๏ธ Performance Breakthroughs

  • Zero-IO Boot: A new deep discovery system scans for Policies, Listeners, Views, and Translations during caching (modular:cache). In production, this eliminates all resource-related filesystem hits.
  • Composer Optimization: Refactored the merge-plugin configuration to use static naming and zero recursion, delivering a 90%+ reduction in Composer overhead for large modular projects.

๐Ÿ›ก๏ธ Architectural Integrity

  • Advanced Dependency Guard: The new modular:check command automatically detects circular dependencies and validates Semver version constraints (e.g., Blog:^1.1) between modules.
  • Stale Resource Protection: Intelligent loaders only register resources that actually exist, preventing "directory not found" exceptions.

๐Ÿง  Modern DX & IDE Support

  • 100% PHPStan Compatibility: The entire codebase is verified at PHPStan Level 5+ with full type safety and explicit return types.
  • Rich IDE Hints: Property and array-shape type hints added to ModuleRegistry and traits for flawless autocomplete in PHPStorm/VSCode.
  • New Toolbar Commands:
    • modular:debug: Instant snapshot of any module's configuration, providers, and middleware.
    • modular:ide-helper: Generates ide helper metadata specifically for modular facades.

๐Ÿงน Other Improvements

  • Standardized use of modern Laravel components for better CLI output.
  • Full support for Case-Insensitive configurations (Blog::key and blog::key).

Upgrade Guide:

  1. Update dependency to ^1.1
  2. Run php artisan modular:install to sync optimized Composer settings.
  3. Run composer dump-autoload
  4. Run php artisan modular:cache to enable performance optimizations.
v1.0.0

๐Ÿš€ v1.0.0 Initial Release

We are excited to announce the first official release of Laravel Modular! This package provides a professional, framework-agnostic modular system engineered for Laravel 11 and 12, allowing you to build scalable and decoupled applications with ease.

โœจ Key Features

๐Ÿ—๏ธ First-Class Artisan Integration

Override 29+ native Artisan commands (including make:model, make:controller, make:migration, etc.) to support the --module flag natively. Every command feels exactly like standard Laravel, but perfectly organized within your modules.

โšก Zero-Config Autoloading

Seamless integration with wikimedia/composer-merge-plugin. Your module-specific composer.json files are automatically discovered and merged, allowing for absolute decoupling and isolated dependency management.

๐Ÿ’Ž Strictly Typed & IDE Ready

The entire codebase is strictly typed (declare(strict_types=1)) and includes comprehensive PHPDocs for maximum stability and a premium developer experience in IDEs like PHPStorm and VSCode.

๐ŸŽจ Flexible Asset & Config Management

  • Configurable Paths: Move your modules and assets anywhere.
  • Dynamic Assets: Built-in support for modular Vite assets and public symlinking via php artisan modular:link.
  • Global Helpers: Access modular resources effortlessly with helpers like module(), module_path(), and module_asset().

โœ… High Reliability

  • CI Optimized: 100% PHPStan level 5 compliance.
  • Fully Tested: Powered by Pest with coverage for core registry and command functionality.
  • Laravel 11 & 12 Ready: Optimized for the latest framework features and file structures.

๐Ÿš€ Getting Started

composer require alizharb/laravel-modular
php artisan modular:install
php artisan make:module Blog
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.
nasirkhan/laravel-sharekit
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony