PHPackages                             dotswan/modules-auto-discover - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dotswan/modules-auto-discover

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dotswan/modules-auto-discover
=============================

Discover configs, translations, views, and .. automatically

0.4(1y ago)514MITPHPPHP ^8.1

Since Oct 10Pushed 1y agoCompare

[ Source](https://github.com/dotswan/modules-auto-discover)[ Packagist](https://packagist.org/packages/dotswan/modules-auto-discover)[ Docs](https://github.com/dotswan/modules-auto-discover)[ RSS](/packages/dotswan-modules-auto-discover/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Modules Auto-Discover
=====================

[](#modules-auto-discover)

Automatically discover and register configurations, translations, and more from your [nWidart/laravel-modules](https://github.com/nWidart/laravel-modules) modules.

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
    - [Auto-Discovery](#auto-discovery)
    - [Disabling Auto-Discovery per Module](#disabling-auto-discovery-per-module)
- [Contributing](#contributing)
- [License](#license)
- [Support](#support)

Introduction
------------

[](#introduction)

When using the `nWidart/laravel-modules` package for modular Laravel applications, you might have noticed that configurations, translations, and other resources within your modules are not automatically discovered and registered by Laravel and you need to register/discover them in the `ModuleServiceProvider` for every module. This package bridges that gap by automatically discovering and registering these resources, simplifying your module development process.

With **Modules Auto-Discover**, you no longer need to manually call methods like `registerConfigs()` or `registerTranslationss()` in your module service providers. The package handles the discovery and registration automatically during the application's boot process.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require dotswan/modules-auto-discover

```

The package uses Laravel's auto-discovery feature, so no additional steps are required to register the service provider.

Usage
-----

[](#usage)

Once installed, the package will automatically discover and register the following resources in your enabled modules:

- **Configurations** (`Config/` directory)
- **Translations** (`Lang/` directory)
- **Views** (`Resources/views/` directory)
- **Routes** (`Routes/` directory)
- **Migrations** (`Database/Migrations/` directory)
- **Factories** (`Database/Factories/` directory)
- **Seeds** (`Database/Seeders/` directory)

### Auto-Discovery

[](#auto-discovery)

By default, auto-discovery is enabled for all your modules. This means that any resources placed in the standard directories will be automatically registered without any additional configuration.

For example, placing a configuration file at `Modules/YourModule/Config/permission.php` will make its contents available via Laravel's `config()` helper:

```
// Accessing a configuration value from your module
$value = config('permission.key');`

```

**Note:** `nWidart Modules` will create a `config.php` file for every module by default (if you enabled to generate), we recommend you to create a separate file for each configuration to avoid conflicts (don't use `config.php` for all modules)

### Disabling Auto-Discovery per Module

[](#disabling-auto-discovery-per-module)

If you want to disable auto-discovery for a specific module, you can do so by adding an `"auto-discovery": false` entry to your module's `module.json` file:

```
{
  "name": "YourModule",
  "alias": "yourmodule",
  ...
  "auto-discovery": false,
  ...
}

```

With `auto-discovery` set to `false`, the package will skip the automatic registration of resources for that module. You can then manually register resources in your module's service provider if needed.

To-Do
-----

[](#to-do)

- Discover `Config`
- Discover `Translations`
- Discover `Views`
- Discover `Routes`
- Discover `Commands`

Contributing
------------

[](#contributing)

Contributions are welcome and encouraged! Please follow these steps to contribute:

1. Fork the repository on GitHub.
2. Create a new branch for your feature or bug fix:

    ```
    git checkout -b feature/your-feature-name

    ```
3. Make your changes.
4. Run `composer lint` to format your code with Pint rules.
5. Run `composer test` to run tests or `composer test-coverage` to generate a coverage report.
6. Commit your changes with clear messages.
7. Push your branch to your forked repository:

    ```
    git push origin feature/your-feature-name

    ```
8. Open a pull request on the main repository.

Please make sure to write tests for your changes and ensure all existing tests pass.

License
-------

[](#license)

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

Support
-------

[](#support)

If you encounter any issues or have questions, please contact us via  or open an issue on the [GitHub repository](https://github.com/dotswan/modules-auto-discover/issues).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

585d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/116f00c234ed446227bf0f5d3355b9f5a57fa6645efe98e139b827b246f6ebec?d=identicon)[majida](/maintainers/majida)

---

Top Contributors

[![majidalavizadeh](https://avatars.githubusercontent.com/u/1640821?v=4)](https://github.com/majidalavizadeh "majidalavizadeh (1 commits)")

---

Tags

auto-discoverymodulemodulesnwidart-moduleslaravelmodulesdotswannwidart-modules

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/dotswan-modules-auto-discover/health.svg)

```
[![Health](https://phpackages.com/badges/dotswan-modules-auto-discover/health.svg)](https://phpackages.com/packages/dotswan-modules-auto-discover)
```

###  Alternatives

[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)

PHPackages © 2026

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