Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
84cb409
Remove the 2.x implementation
Jackardios Sep 23, 2026
fca0ed9
Set up the 3.x tooling
Jackardios Sep 23, 2026
9a6409f
Add the module manifest
Jackardios Sep 23, 2026
487bcf4
Load module resources by convention
Jackardios Sep 23, 2026
21f316d
Add --module to every generator
Jackardios Sep 23, 2026
a3366e4
Add the module lifecycle commands
Jackardios Sep 23, 2026
a438a81
Wire the package in one service provider
Jackardios Sep 23, 2026
fd8bae9
Add the test infrastructure and the fixture application
Jackardios Sep 23, 2026
08ebfa4
Test the manifest and the scaffolding units
Jackardios Sep 23, 2026
1b6aadd
Test the conventions, the discovery and the commands
Jackardios Sep 23, 2026
daf7813
Test --module on every generator
Jackardios Sep 23, 2026
f0879e5
Test the package under Octane and its architecture rules
Jackardios Sep 23, 2026
8ed4e9c
Document 3.0
Jackardios Sep 23, 2026
2320170
Register module resources early and tolerate a stale manifest cache
Jackardios Sep 23, 2026
e2067df
Keep Packagist mirrors and file modes when editing composer.json
Jackardios Sep 23, 2026
990e556
Apply the generators config to nested generators
Jackardios Sep 23, 2026
3e7e904
Document the review findings
Jackardios Sep 23, 2026
330160f
Test the form requests of an application controller
Jackardios Sep 23, 2026
fe9cf29
Treat any repository named packagist.org as the Packagist slot
Jackardios Sep 23, 2026
178577e
Exclude the vendor from named Packagist mirrors and check copies by t…
Jackardios Sep 23, 2026
83cfaaf
Map nested tests and model options of generators
Jackardios Sep 23, 2026
90e6d1b
Document named Packagist mirrors and the generator mapping limits
Jackardios Sep 23, 2026
ea9069f
Exclude the vendor from every repository that serves Packagist
Jackardios Sep 23, 2026
ab6dfc4
Map --model only for the Laravel generators and allow an empty namespace
Jackardios Sep 23, 2026
00a36f7
Read command input without relying on inferred types
Jackardios Sep 23, 2026
445fd1d
Check module files for deletion only when the manifest is cached
Jackardios Sep 23, 2026
8efcdf0
Keep the tests and names working on PHP 8.6
Jackardios Sep 23, 2026
a22dd42
Install the CI dependencies on Windows and PHP 8.6
Jackardios Sep 23, 2026
36218d5
Run the tests on Windows
Jackardios Sep 23, 2026
7962bf3
Remove the vendor link of a deleted module on Windows
Jackardios Sep 23, 2026
b57b426
Clear the stat cache before removing the vendor link of a deleted module
Jackardios Sep 23, 2026
ed38d77
Detect a dangling vendor link with is_dir(), which works on Windows
Jackardios Sep 23, 2026
397bd24
Explain why the package exists and add a quick start to the README
Jackardios Sep 24, 2026
abe5770
Join generator namespaces without empty segments and keep kebab case …
Jackardios Sep 24, 2026
15dd57c
Discover commands and seeders only in files that declare their class
Jackardios Sep 24, 2026
c58fcd1
Accept array autoload mappings of factories and seeders in module:doctor
Jackardios Sep 24, 2026
0693659
Complete the upgrade guide and the changelog for 3.0
Jackardios Sep 24, 2026
8128916
Release 3.0.0 and require the Windows tests to pass
Jackardios Sep 24, 2026
58dd231
Merge the 2.x history of master into 3.x
Jackardios Sep 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto eol=lf

/.github export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml export-ignore
/pint.json export-ignore
84 changes: 40 additions & 44 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@ name: Tests

on:
push:
branches: [master, 2.x]
branches: [master, 3.x]
pull_request:
branches: [master, 2.x]
branches: [master, 3.x]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}

strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
laravel: ['10.*', '11.*', '12.*', '13.*']
exclude:
- { php: '8.1', laravel: '11.*' }
- { php: '8.1', laravel: '12.*' }
- { php: '8.1', laravel: '13.*' }
- { php: '8.2', laravel: '13.*' }
- { php: '8.5', laravel: '10.*' }
- { php: '8.5', laravel: '11.*' }

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
os: [ubuntu-latest]
php: ['8.3', '8.4', '8.5']
dependencies: [stable]
experimental: [false]
include:
- { os: ubuntu-latest, php: '8.3', dependencies: lowest, experimental: false }
- { os: windows-latest, php: '8.4', dependencies: stable, experimental: false }
- { os: ubuntu-latest, php: '8.6', dependencies: stable, experimental: true }

name: PHP ${{ matrix.php }} - ${{ matrix.dependencies }}${{ matrix.os == 'windows-latest' && ' - Windows' || '' }}

steps:
- name: Checkout code
Expand All @@ -38,34 +42,20 @@ jobs:
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, json
extensions: dom, curl, fileinfo, libxml, mbstring, zip, json, pdo_sqlite
coverage: none

# Laravel 10 and 11 are no longer supported and get no security fixes, so the advisories block them.
- name: Allow unsupported Laravel versions
if: matrix.laravel == '10.*' || matrix.laravel == '11.*'
run: composer remove --dev roave/security-advisories --no-update --no-interaction

# PHP 8.1 is no longer supported either: the test tools that still run on it have advisories,
# and the later releases of the snapshot plugin that allow it are broken.
- name: Use the last test tools for PHP 8.1
if: matrix.php == '8.1'
run: |
composer config audit.block-insecure false
composer require --dev "spatie/pest-plugin-snapshots:2.2.1" "spatie/phpunit-snapshot-assertions:5.2.3" --no-update --no-interaction

# Packages declare the PHP versions they support, and a PHP release in development is newer than all of them.
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction
run: composer update --prefer-dist --no-interaction ${{ matrix.dependencies == 'lowest' && '--prefer-lowest --prefer-stable' || '' }} ${{ matrix.php == '8.6' && '--ignore-platform-req=php+' || '' }}

- name: Run tests
run: composer test
run: vendor/bin/pest --parallel --order-by=random

static-analysis:
coverage:
runs-on: ubuntu-latest

name: Static Analysis
name: Coverage

steps:
- name: Checkout code
Expand All @@ -76,23 +66,23 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: '8.3'
extensions: dom, curl, libxml, mbstring, zip, json
coverage: none
php-version: '8.5'
extensions: dom, curl, libxml, mbstring, zip, json, pdo_sqlite
coverage: pcov

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Run PHPStan
run: composer analyse
- name: Check the coverage
run: vendor/bin/pest --coverage --min=95

- name: Audit dependencies
run: composer audit
- name: Check the mutation score
run: vendor/bin/pest --mutate --everything --covered-only --parallel --min=85

code-style:
static-analysis:
runs-on: ubuntu-latest

name: Code Style
name: Static Analysis

steps:
- name: Checkout code
Expand All @@ -110,5 +100,11 @@ jobs:
- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Run PHPStan
run: composer analyse

- name: Check code style
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes
run: composer lint

- name: Audit dependencies
run: composer audit
39 changes: 0 additions & 39 deletions .php-cs-fixer.dist.php

This file was deleted.

69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Changelog

All notable changes to this project are documented in this file.

## 3.0.0 - 2026-09-24

Version 3 is a rewrite. See [UPGRADE.md](UPGRADE.md) for the upgrade from 2.x.

### Added

- `--module` for every generator: the Laravel `make:*` commands, `make:migration`, the table migration generators
and the generators of other packages that extend `GeneratorCommand` (`make:action`, `make:data`, ...).
- Module resources are loaded by convention: config, translations (JSON included), views, class and anonymous
Blade components, migrations, factories, routes and commands. Modules no longer need their own service
provider.
- Tinker aliases the module classes.
- Route groups in `config/modules.php`; nested route directories are appended to the group prefix.
- The `generators` config maps generator commands to namespaces inside the modules.
- `Modules::seeders()` returns the seeders of all modules, in the order of their `_N` suffix.
- Module templates in `stubs/module/<preset>` with `{{ variable|filter }}` placeholders in paths and contents.
- `module:doctor` checks the modules and how they are installed; `module:list -v` shows what each module loads.
- `Modules::all()`, `Modules::find()` and `Modules::get()` find modules by their directory name.
- The `modules-config` and `modules-stubs` publish tags.
- `--no-update` for `module:make`, `module:sync` and `module:delete`: edit `composer.json` and print the
Composer command instead of running it.
- `module:sync` adds the `autoload-dev` of the module tests and updates only the modules that changed.
- Packagist mirrors defined in the project get the exclusion of the module vendor too: repositories with a
`packagist.org` URL, repositories under the `packagist` or `packagist.org` key, and list entries named
`packagist` or `packagist.org`.
- The module manifest is cached by `php artisan optimize` and cleared by `optimize:clear`; `MODULES_CACHE`
changes the cache path.
- The modules path is added to `octane.watch`.
- The `about` command shows the modules.

### Changed

- Requires PHP 8.3 and Laravel 13.12.
- The facade is `Laraneat\Modules\Facades\Modules`; modules are identified by their directory name.
- The four providers of `Laraneat\Modules\Providers` are replaced by `Laraneat\Modules\ModulesServiceProvider`,
and the config publish tag `config` by `modules-config`.
- `Laraneat\Modules\Module` is a read-only value object with public properties.
- The views and translations namespace of a module is its directory name. Every `config/*.php` file of a
module is merged, not only `config/<module>.php`.
- Route files of a directory are loaded before its subdirectories.
- An invalid module `composer.json` fails the application boot, and two modules can not share a namespace.
2.x skipped a module without a name.
- `module:make` requires new modules with `*@dev` and has no `--force` option.
- `ModuleNotFound` is created with `ModuleNotFound::named()`; every exception implements `ModulesException`.
- `module:delete` deletes one module, found by its directory name, asks for confirmation and needs `--force`
in non-interactive mode.
- The manifest cache is written only by `php artisan optimize` and `module:cache`, not automatically in
production, to `bootstrap/cache/modules.php` instead of `bootstrap/cache/laraneat-modules.php`.
- `Laraneat\Modules\ModulesRepository` is renamed to `Laraneat\Modules\ModuleRepository`.
- The `composer.vendor` config key is renamed to `vendor`.
- Migrations are registered only in the console.

### Removed

- The `module:make:*` component generators and their stubs, `module:stub:publish` and the `custom_stubs` config.
- `module:migrate` and the `module:migrate:*` commands: use `migrate` and the `migrate:*` commands.
- `Laraneat\Modules\Support\ModuleServiceProvider`, `CanLoadRoutesFromDirectory` and `CanRunModuleSeeders`.
- The methods of `ModulesRepository` and the getters, macros and `toArray()` of `Module`: UPGRADE.md maps them
to 3.0.
- `Laraneat\Modules\Enums`, `Laraneat\Modules\Support\Generator`, `Support\Composer`, `Support\ComposerJsonFile`,
`Support\ModuleConfigWriter`, `Support\Migrations` and the 2.x exceptions except `ModuleNotFound`.
- `module:make --preset=plain|base|api` and `--entity`: module templates replace them.
- `InteractsWithTestUser` and `WithJsonResponseHelpers`: UPGRADE.md has versions to copy into the application.
- The `components`, `composer.author`, `user_model`, `create_permission` and `cache` config keys.
- The `composer/composer` dependency.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2025 Salavat Salakhutdinov
Copyright (c) 2021 Salakhutdinov Salavat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading