PHPackages                             vircom/laravel-modules-loader - 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. vircom/laravel-modules-loader

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

vircom/laravel-modules-loader
=============================

Laravel modules loader library

1.0.1(9y ago)1171MITPHPPHP &gt;=7.0

Since Sep 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vircom/laravel-modules-loader)[ Packagist](https://packagist.org/packages/vircom/laravel-modules-loader)[ Docs](http://vircom.pl)[ RSS](/packages/vircom-laravel-modules-loader/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (5)Versions (5)Used By (0)

Laravel modules loader library
==============================

[](#laravel-modules-loader-library)

[![Packagist](https://camo.githubusercontent.com/895179616332c4bf2d2ab8e38c0a01da0e7fcc5c3cb09c55b44794fe2f3de17c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73796d666f6e792f73796d666f6e792e7376673f6d61784167653d32353932303030)](https://github.com/vircom/laravel-modules-loader)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/9ee489d2b4fa0533fce6ad4ecf6af3fea38788e5be2add7a1bd2108eae653cb0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f766972636f6d2f6c61726176656c2d6d6f64756c65732d6c6f616465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/vircom/laravel-modules-loader)[![SensioLabsInsight](https://camo.githubusercontent.com/2c8b460df35edde98e301c9d7d40194399a9558b641ff4ef810c77b18b79f334/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f34386637323032312d656532642d346330622d386465362d6362323364646136636532332e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/48f72021-ee2d-4c0b-8de6-cb23dda6ce23)[![Total Downloads](https://camo.githubusercontent.com/47b273bd392fa8b44341dbf4acdc2f4a7ebaf3d1ae5f88f951a7ac5d2d4eca2e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766972636f6d2f6c61726176656c2d6d6f64756c65732d6c6f616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vircom/laravel-modules-loader)

vircom/laravel-modules-loader is a Laravel package allows you to easy loads modules used in your application.

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

[](#installation)

The recommended way to install Laravel modules loader library is through [Composer](http://getcomposer.org/).

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

Next, you should run command below, to install the latest stable version of package:

```
composer.phar require vircom/laravel-modules-loader
```

Next add the following service provider in `config/app.php`.

```
'providers' => [
  VirCom\Laravel\ModulesLoader\ModulesLoaderServiceProvider::class,
],
```

At least, public modules configuration file:

```
php artisan vendor:publish --provider="VirCom\Laravel\ModulesLoader\ModulesLoaderServiceProvider"
```

Configuration
-------------

[](#configuration)

Controllers, repositories and other module code parts are not loaded by default. At first, you should add to your **composer.json** lines, to load PSR-4 files. Example:

```
{
  "autoload": {
    "psr-4": {
      "App\\": "app/",
      "YourVendor\\ModuleName\\SubmoduleName\\Module\\": "modules/Module/src/"
    }
  }
}
```

Dont forget to run command:

```
composer dump-autoload
```

After that, create **modules** directory and module structre inside it:

```
modules
+-- src
|   +-- Module
|       +-- Module.php

```

**Module.php** file must be subclass of Illuminate\\Support\\ServiceProvider larvel provider class. So for example, looks like below:

```
