On this page you can find all versions of the php package
tey/mod. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor tey Package mod Short Description Lightweight toolkit for modular development in Laravel, for you and your coding agents. Choose or extend common layouts like DDD and modular monoliths, or create your own. License
MIT Homepage https://github.com/teylabs/mod
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Mod is a lightweight toolkit for modular development in Laravel, for you and your coding agents.
Laravel lets you organize your app however you like. Mod makes that easy without fighting the framework: start from Laravel's defaults, adopt patterns from modular or domain-driven designs where they help, and keep Laravel's own make:* commands and conventions throughout.
Created by Jasper Tey, building on the lessons from laravel-ddd and generalized for the many different ways developers and their agents organize growing Laravel applications.
> [!NOTE]
> Mod is pre-1.0. Minor releases may change the API until 1.0.
- [Six built-in layouts](https://mod.teylabs.com/basics/layouts), including modular monolith and DDD, or your own
- [Laravel's own generators](https://mod.teylabs.com/basics/generating-files) for every file type, writing into your layout, with related files alongside
- [Templates and scaffolds](https://mod.teylabs.com/going-further/scaffolds): turn your own patterns into commands, then [rename a whole cluster](https://mod.teylabs.com/going-further/renaming) when the feature changes
- [Auto-discovery](https://mod.teylabs.com/basics/auto-discovery) of providers, commands, listeners, migrations, factories and policies
- **Agent-friendly**: your structure lives in code, so coding agents can look it up and preview every write. See [Working with AI agents](#working-with-ai-agents).
The full documentation is at [mod.teylabs.com](https://mod.teylabs.com).
## Installation
Mod requires PHP 8.3+ and Laravel 12 or 13.
## Quick Start
Choose a layout in `config/mod.php`:
Generate a model with its migration and factory, then migrate:
## What Mod Does
| | Try it | Learn more |
| --- | --- | --- |
| Layouts | `'layout' => 'modules'` in `config/mod.php` | [Layouts](https://mod.teylabs.com/basics/layouts) |
| Generators | `mod:model Knowledge:Document --all` | [Generating files](https://mod.teylabs.com/basics/generating-files) |
| Auto-discovery | providers, commands, listeners, migrations, factories and policies, found wherever they live | [Auto-discovery](https://mod.teylabs.com/basics/auto-discovery) |
| Your own generators | `mod:template tool`, then `mod:tool Knowledge:Search` | [Custom generators](https://mod.teylabs.com/going-further/custom-generators) |
| Scaffolds | several related files from one recipe | [Scaffolds](https://mod.teylabs.com/going-further/scaffolds) |
| Module routes and views | `Mod::routes()`, `view('knowledge::documents.show')` | [Routes](https://mod.teylabs.com/going-further/routes) |
| Renames | `mod:rename Knowledge:Document Knowledge:Article` | [Renaming](https://mod.teylabs.com/going-further/renaming) |
## Working with AI Agents
Conventions written in a prompt drift as an app grows. Mod keeps your structure in code, where coding agents can ask for it:
- `php artisan mod:list --json` tells an agent where every kind of file goes.
- Every command that writes files previews its plan with `--dry-run --json`.
- Mod ships a [Laravel Boost](https://laravel.com/docs/boost) guideline, skills and read-only MCP tools. Run `php artisan boost:install` and choose `tey/mod`.
Load `mod-development` for the generator and layout reference. Load [`mod-learning-patterns`](resources/boost/skills/mod-learning-patterns/SKILL.md) to survey this app, confirm recurring structure in its code and history, propose a layout and scaffold recipes, check with `mod-fit` when available, and iterate. Proposals are code for human review, never adopted automatically. The [worked example](docs/learning-patterns.md) verifies a survey-derived layout and recipe with the inventory and real generators.
The tools are `mod-inventory` for configured placement, `mod-plan` for a command preview, `mod-survey` for the app's actual structure, and `mod-fit` to check an uninstalled layout or recipe. Call `mod-survey` with no arguments. It reports all classes by file type, folder and namespace, unplaced paths, class/page/route/policy references, recurring file sets, naming patterns, vendor-owned references and Git identity. It falls back to the `laravel` layout when none is configured.
For example, part of a survey can look like:
The survey reads only `base_path()` and its local Git metadata. It rejects path arguments and skips discovered symlinks, `.env*`, `storage/`, keys, logs and databases, and uses `vendor/` only to classify referenced classes. It returns structure, never file contents; it writes nothing and makes no network calls. See the [survey contract and limits](resources/boost/skills/mod-development/SKILL.md#read-only-boost-tools-and-import-metadata). Files larger than 1 MiB (1,048,576 bytes) are skipped before reading; `skipped` lists their relative paths with `size-limit`, and links with `symlink`. `bootstrap/cache`, `public/build`, `public/hot` and `public/storage` are excluded.
Pass `mod-fit` a structured layout definition, a recipe's expected members, or both. For example, `{"layout":{"base":"modules","path":"app/Areas/{area}"}}` checks a proposed layout without registering it. The sorted JSON reports `owned`, `unowned`, `conflicts`, `variances` with the paths found, `missing`, `outside` files touching the recipe, and unowned callback `configuration`. An agent can supply variance evidence when a role has another name or mechanism. The fit check uses the same privacy boundary as the survey, with no writes, network calls or execution of scanned PHP. See the [input, examples and limits](docs/fit.md).
See [Agents](https://mod.teylabs.com/going-further/agents).
## FAQ
### Can I Add Mod to an Existing App?
Yes. Mod doesn't move existing files, and `make:*` keeps working. Start on the `laravel` layout and switch when you're ready.
### When to Choose Mod over the Alternatives
There are several good ways to organize a Laravel app. Pick by what you need:
- **[nwidart/laravel-modules](https://github.com/nWidart/laravel-modules)**: modules you can switch on and off, each with its own config and assets. The most established option.
- **[InterNACHI/modular](https://github.com/InterNACHI/modular)**: each module as its own Composer package, close to plain Laravel, with Blade components and translations loaded per module.
- **[laravel-ddd](https://github.com/teylabs/laravel-ddd)**: mod's precursor, for domain-driven design with nothing else to learn. Mod's `ddd` layout keeps the same folders if you outgrow it.
- **Mod**: your own structure, whether feature folders, vertical slices, DDD, a modular monolith or a mix, with Laravel's own `make:*`, generators for your team's patterns, and a structure your coding agents can read.
Mod isn't the right fit yet if you need a stable 1.0 API, per-module translations or assets, or modules you can switch on and off at runtime.
## Documentation
Everything else, including [configuration](https://mod.teylabs.com/reference/configuration), [production caching](https://mod.teylabs.com/basics/auto-discovery#caching-discovery-in-production) and the [command reference](https://mod.teylabs.com/reference/commands), is at [mod.teylabs.com](https://mod.teylabs.com).
## Testing
## Changelog
See [CHANGELOG](CHANGELOG.md) for what has changed recently.
## Contributing
See [CONTRIBUTING](https://github.com/teylabs/.github/blob/main/CONTRIBUTING.md). Questions and ideas go to [Discussions](https://github.com/teylabs/mod/discussions).
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Jasper Tey](https://github.com/jaspertey)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package tey/mod contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.