1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-06-21 01:54:03 +00:00
tenancy/resources/boost/skills/laravel-tenancy/references/pending-tenants.md

974 B

Pending Tenants Reference

Use this when maintaining a pool of prepared tenants.

Source Files

  • src/Commands/CreatePendingTenants.php
  • src/Commands/ClearPendingTenants.php
  • src/Database/Concerns/HasPending.php
  • src/Database/Concerns/PendingScope.php
  • src/Jobs/CreatePendingTenants.php
  • src/Jobs/ClearPendingTenants.php

Config

  • pending.include_in_queries
  • pending.count, defaulting to TENANCY_PENDING_COUNT or 5

Commands

php artisan tenants:pending-create
php artisan tenants:pending-create --count=10
php artisan tenants:pending-clear
php artisan tenants:pending-clear --older-than-days=7
php artisan tenants:pending-clear --older-than-hours=12

Rules

  • When include_in_queries is false, pending tenants are excluded from tenant queries and tenant commands.
  • Use withPending(), withoutPending(), and onlyPending() intentionally.
  • Test command behavior with and without pending tenants included in queries.