PHPackages                             jblaak/php-modules - 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. jblaak/php-modules

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

jblaak/php-modules
==================

1.3.0(1y ago)09.2k↓33.9%[4 issues](https://github.com/JBlaak/PHP-Modules/issues)PHPPHP ^8.1

Since Jan 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/JBlaak/PHP-Modules)[ Packagist](https://packagist.org/packages/jblaak/php-modules)[ RSS](/packages/jblaak-php-modules/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (8)Versions (8)Used By (0)

PHP Modules
===========

[](#php-modules)

Declare clear dependencies within your application by defining which modules have access to other parts of your application.

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

[](#installation)

This package will soon be published on Packagist, however it is still in development.

Features
--------

[](#features)

Run module checks on your codebase using the `test` command

```
./vendor/bin/modules test
```

Generate a dependency graph, make sure you have installed [GraphViz](https://graphviz.org/download/) for this.

```
./vendor/bin/modules graph
```

Defining modules
----------------

[](#defining-modules)

Your `modules.php` file in the root of your project will be where your configuration will live. This file should return an instance of `PhpModules\Lib\Modules`.

Let's say we have a module in the namespace `App\Http` that depends on `App\Persistence`, we can define this as follows:

```
