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 Modules Laravel Package

mozex/laravel-modules

View on GitHub
Deep Wiki
Context7

Laravel Modules

Latest Version on Packagist GitHub Checks Workflow Status Docs License Total Downloads

A zero-config modular architecture package for Laravel. Create a Modules/ directory, drop in your module folders, and the package auto-discovers and registers everything: configs, routes, views, Blade components, migrations, seeders, commands, service providers, helpers, translations, models, factories, policies, events, listeners, Livewire components, Filament resources, and Nova resources.

Read the full documentation at mozex.dev: searchable docs, version requirements, detailed changelog, and more.

Table of Contents

Support This Project

I maintain this package along with several other open-source PHP packages used by thousands of developers every day.

If my packages save you time or help your business, consider sponsoring my work on GitHub Sponsors. Your support lets me keep these packages updated, respond to issues quickly, and ship new features.

Business sponsors get logo placement in package READMEs. See sponsorship tiers →

What You Get

Convention over configuration. Module directory names become view namespaces, Blade component prefixes, and translation keys. Modules/Blog/ gives you view('blog::home'), <x-blog::card />, and __('blog::messages.welcome') with no setup.

Everything auto-discovered. Routes load with the right middleware groups based on filename (web.php gets web middleware, api.php gets api prefix and middleware). Service providers register themselves. Commands appear in Artisan. Migrations run with php artisan migrate. Factories and policies resolve from models automatically.

Full Livewire v4 support. Class-based components, single-file components (SFC), and multi-file components (MFC) all work with namespaced aliases like <livewire:blog::editor />.

Filament v5 integration. Resources, pages, widgets, and clusters register with panels based on directory structure. Put a resource in Filament/Admin/Resources/ and it shows up in the admin panel.

Fine-grained control when you need it. Enable or disable individual modules, set load order, toggle specific features, and override discovery patterns. All from config/modules.php.

Production-ready caching. One command (php artisan modules:cache) caches all discovery results. No scanning on every request.

Installation

Requires PHP 8.3+ - see all version requirements

composer require mozex/laravel-modules

Register the Modules namespace in your project's composer.json:

{
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Modules\\": "Modules/"
        }
    }
}

Regenerate the autoloader:

composer dump-autoload

Optionally publish the config to change defaults:

php artisan vendor:publish --tag=laravel-modules-config

Quick Start

Create a module with a route and a view:

Modules/
└── Blog/
    ├── Routes/
    │   └── web.php
    └── Resources/
        └── views/
            └── index.blade.php

The route file works like any Laravel route file:

use Illuminate\Support\Facades\Route;

Route::get('/blog', fn () => view('blog::index'));

That's a working module. The route loads with the web middleware group (because the file is named web.php) and the view is accessible through the blog:: namespace. Add more directories as you need them: Models/, Livewire/, Filament/Admin/Resources/, and so on. The package picks up each one based on the conventions documented in the feature guides.

For a complete module structure, configuration reference, facade API, and detailed feature documentation, visit the documentation site.

Resources

Visit the documentation site for searchable docs auto-updated from this repository.

  • AI Integration: Use this package with AI coding assistants via Context7 and Laravel Boost
  • Requirements: PHP, Laravel, and dependency versions
  • Changelog: Release history with linked pull requests and diffs
  • Contributing: Development setup, code quality, and PR guidelines
  • Questions & Issues: Bug reports, feature requests, and help
  • Security: Report vulnerabilities directly via email

License

The MIT License (MIT). Please see License File for more information.

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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle