Skip to content

[4.x] Add --skip-tenants option to HasTenantOptions#1436

Open
jimish-gamit wants to merge 5 commits intoarchtechx:masterfrom
jimish-gamit:feat/skip-tenants
Open

[4.x] Add --skip-tenants option to HasTenantOptions#1436
jimish-gamit wants to merge 5 commits intoarchtechx:masterfrom
jimish-gamit:feat/skip-tenants

Conversation

@jimish-gamit
Copy link

Summary

Adds a --skip-tenants option to all tenant artisan commands (tenants:run, tenants:migrate, tenants:rollback, tenants:seed, tenants:up, tenants:down).

The option is the complement of the existing --tenants option instead of specifying which tenants to include, you specify which to exclude.

Changes

  • src/Concerns/HasTenantOptions.php Added --skip-tenants=* option to getOptions() and a whereNotIn clause in getTenantsQuery() to exclude the specified tenants from the query. Since all tenant commands share this trait, the option is available across all of them.
  • src/Commands/Run.php Added --skip-tenants=* to the command signature so it appears in tenants:run --help.

Usage

# Works on all tenant commands
php artisan tenants:migrate --skip-tenants=tenant3

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.10%. Comparing base (8f3ea62) to head (841d8cd).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1436      +/-   ##
============================================
+ Coverage     86.08%   86.10%   +0.01%     
  Complexity     1148     1148              
============================================
  Files           184      184              
  Lines          3363     3367       +4     
============================================
+ Hits           2895     2899       +4     
  Misses          468      468              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jimish-gamit jimish-gamit marked this pull request as draft March 2, 2026 07:14
@jimish-gamit jimish-gamit marked this pull request as ready for review March 2, 2026 08:06
@gjimish
Copy link

gjimish commented Mar 7, 2026

Hi @stancl

Just checking in on this PR. Let me know if there’s any feedback or changes needed from my side, happy to update it.

Thanks for your time!

@stancl stancl changed the title [Feature] --skip-tenants option to tenant commands [4.x] Add --skip-tenants option to HasTenantOptions Mar 9, 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.

3 participants