Skip to content

Conversation

@outafrica
Copy link

Summary

  • Added include_modules and exclude_modules configuration options to control which modules have their migrations auto-discovered
  • Useful for multi-tenancy scenarios (e.g., tenancyforlaravel.com) where you need to separate "root" migrations from "tenant" migrations

Changes

  • Added include_modules config key - when non-empty, only these modules have migrations auto-discovered
  • Added exclude_modules config key - modules listed here are excluded from migration auto-discovery
  • Include takes precedence over exclude if both are defined
  • Added getModulesForMigration() helper method to LaravelModulesServiceProvider
  • Added 5 new tests covering all filtering scenarios

Usage

// config/modules.php

// Multi-tenancy: Only auto-discover tenant module migrations
'auto-discover' => [
    'migrations' => true,
    'include_modules' => ['Tenant', 'TenantBilling', 'TenantUsers'],
],

// Or exclude root modules from tenant migration runs
'auto-discover' => [
    'migrations' => true,
    'exclude_modules' => ['Core', 'Admin', 'SystemSettings'],
],

@outafrica outafrica closed this Jan 2, 2026
@outafrica outafrica reopened this Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant