mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-21 22:24:04 +00:00
Add detailed tenancy references and guidelines to boost resources
This commit is contained in:
parent
c94c0cd932
commit
fde2bf0cf4
21 changed files with 1707 additions and 1 deletions
36
resources/boost/skills/tenancy/references/impersonation.md
Normal file
36
resources/boost/skills/tenancy/references/impersonation.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# User Impersonation Reference
|
||||
|
||||
Use this when implementing tenant user impersonation.
|
||||
|
||||
## Source Files
|
||||
|
||||
- `src/Features/UserImpersonation.php`
|
||||
- `src/Database/Models/ImpersonationToken.php`
|
||||
- `assets/impersonation-migrations/*`
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
php artisan vendor:publish --provider="Stancl\Tenancy\TenancyServiceProvider" --tag=impersonation-migrations
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
Enable feature:
|
||||
|
||||
```php
|
||||
'features' => [
|
||||
Stancl\Tenancy\Features\UserImpersonation::class,
|
||||
],
|
||||
```
|
||||
|
||||
## Command
|
||||
|
||||
```bash
|
||||
php artisan tenants:purge-impersonation-tokens
|
||||
```
|
||||
|
||||
## Rules
|
||||
|
||||
- Verify tenant match before logging in impersonated users.
|
||||
- Test guard, redirect URL, remember flag, token TTL, and invalid token behavior.
|
||||
- Purge expired tokens routinely.
|
||||
Loading…
Add table
Add a link
Reference in a new issue