# Introduction

**Package:** Laravel Modules | **Version:** 3 | **URL:** https://mozex.dev/docs/laravel-modules/v3

---

Laravel Modules brings a clean, zero-config modular structure to your Laravel app. Drop your modules into the `Modules/` directory and the package auto-discovers and wires everything: configs, service providers, helpers, artisan commands, migrations, translations, views, Blade components, routes, schedules, listeners, Livewire components, Filament resources, Nova resources, and more.

## What you get

- **Auto-discovery**: namespaces, view aliases, and route groups are derived from your module's directory name. No registration boilerplate.
- **Fine-grained control**: enable or disable modules, set load order, and override discovery patterns from `config/modules.php`.
- **Built-in caching**: a single discovery cache keeps scanning fast in production.

## Installation

Install with Composer:

```bash
composer require mozex/laravel-modules
```

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

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

Then regenerate the autoloader:

```bash
composer dump-autoload
```

Publish the config file (optional, only if you want to change defaults):

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

## Quick start

By default, modules live under `Modules/` at your project root. Each module follows a conventional directory structure:

```
Modules/
├── Blog/
│   ├── Config/
│   ├── Console/Commands/
│   ├── Database/
│   │   ├── Factories/
│   │   ├── Migrations/
│   │   └── Seeders/
│   ├── Filament/
│   ├── Lang/
│   ├── Listeners/
│   ├── Models/
│   ├── Policies/
│   ├── Providers/
│   ├── Resources/views/
│   ├── Routes/
│   └── View/Components/
└── Shop/
    └── ...
```

Use your assets through namespaced conventions:

- **Views**: `view('blog::post.show')` maps to `Modules/Blog/Resources/views/post/show.blade.php`
- **Class-based Blade components**: `<x-blog::post.card/>` maps to `Modules/Blog/View/Components/Post/Card.php`
- **Anonymous components**: `<x-blog::button.primary/>` maps to `Modules/Blog/Resources/views/components/button/primary.blade.php`
- **Routes**: files under `Modules/*/Routes/*.php` load automatically with sensible group defaults (web, api)

Browse the feature guides in the sidebar for detailed documentation on each capability.

---

## Table of Contents

- [Introduction](https://mozex.dev/docs/laravel-modules/v3)
- [Support Us](https://mozex.dev/docs/laravel-modules/v3/support-us)
- [Requirements](https://mozex.dev/docs/laravel-modules/v3/requirements)
- [Changelog](https://mozex.dev/docs/laravel-modules/v3/changelog)
- [Contributing](https://mozex.dev/docs/laravel-modules/v3/contributing)
- [Questions & Issues](https://mozex.dev/docs/laravel-modules/v3/questions-and-issues)
- [About Mozex](https://mozex.dev/docs/laravel-modules/v3/about)

### Features

- [Blade Components](https://mozex.dev/docs/laravel-modules/v3/features/blade-components)
- [Views](https://mozex.dev/docs/laravel-modules/v3/features/views)
- [Routes](https://mozex.dev/docs/laravel-modules/v3/features/routes)
- [Configs](https://mozex.dev/docs/laravel-modules/v3/features/configs)
- [Migrations](https://mozex.dev/docs/laravel-modules/v3/features/migrations)
- [Seeders](https://mozex.dev/docs/laravel-modules/v3/features/seeders)
- [Commands](https://mozex.dev/docs/laravel-modules/v3/features/commands)
- [Helpers](https://mozex.dev/docs/laravel-modules/v3/features/helpers)
- [Models & Factories](https://mozex.dev/docs/laravel-modules/v3/features/models-factories)
- [Policies](https://mozex.dev/docs/laravel-modules/v3/features/policies)
- [Events & Listeners](https://mozex.dev/docs/laravel-modules/v3/features/events-listeners)
- [Service Providers](https://mozex.dev/docs/laravel-modules/v3/features/service-providers)
- [Translations](https://mozex.dev/docs/laravel-modules/v3/features/translations)
- [Caching](https://mozex.dev/docs/laravel-modules/v3/features/caching)
- [Listing Modules](https://mozex.dev/docs/laravel-modules/v3/features/listing)
- [Livewire Components](https://mozex.dev/docs/laravel-modules/v3/features/livewire-components)
- [Filament](https://mozex.dev/docs/laravel-modules/v3/features/filament)
- [Nova Resources](https://mozex.dev/docs/laravel-modules/v3/features/nova-resources)

### Integrations

- [PHPStan](https://mozex.dev/docs/laravel-modules/v3/integrations/phpstan)
- [PHPUnit](https://mozex.dev/docs/laravel-modules/v3/integrations/phpunit)
- [Pest](https://mozex.dev/docs/laravel-modules/v3/integrations/pest)