PHPackages                             xyorqin/tenant-terminal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. xyorqin/tenant-terminal

ActiveLibrary[CLI &amp; Console](/categories/cli)

xyorqin/tenant-terminal
=======================

Interactive terminal for running Laravel commands within tenant context

00PHP

Since Feb 21Pushed 4mo agoCompare

[ Source](https://github.com/Xyorqin/tenant-terminal)[ Packagist](https://packagist.org/packages/xyorqin/tenant-terminal)[ RSS](/packages/xyorqin-tenant-terminal/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Xyorqin Tenant Terminal
=======================

[](#xyorqin-tenant-terminal)

Interactive terminal for running Laravel commands within tenant context. Instead of typing `php artisan tenants:run command --tenant=id`, simply run `php artisan tenant`, select a tenant, and all subsequent commands will run in that tenant's context.

Installation
------------

[](#installation)

### Via Composer (Packagist)

[](#via-composer-packagist)

Eng oson usul - Packagist orqali:

```
composer require xyorqin/tenant-terminal
```

### Git Repository orqali

[](#git-repository-orqali)

Agar paket hali Packagist da bo'lmasa:

1. Git repository URL ni oling (GitHub, GitLab, Bitbucket, va h.k.)
2. Loyihangizning `composer.json` fayliga qo'shing:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/your-username/tenant-terminal.git"
        }
    ],
    "require": {
        "xyorqin/tenant-terminal": "dev-main"
    }
}
```

3. Composer orqali o'rnating:

```
composer require xyorqin/tenant-terminal:dev-main
```

### Local Path orqali (Development)

[](#local-path-orqali-development)

1. Paket local papkada bo'lsa:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "./path/to/tenant-terminal"
        }
    ],
    "require": {
        "xyorqin/tenant-terminal": "*"
    }
}
```

2. Run `composer update`

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=tenant-terminal-config
```

This will create a `config/tenant-terminal.php` file where you can customize the package settings.

### Supported Tenant Packages

[](#supported-tenant-packages)

The package automatically detects and works with:

- **stancl/tenancy** - Most popular Laravel tenancy package
- **spatie/laravel-multitenancy** - Spatie's multitenancy package
- **Custom tenant models** - Configure via `tenant_model` in config

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

1. Run the tenant command:

    ```
    php artisan tenant
    ```
2. You'll see a list of available tenants:

    ```
    Available Tenants:

      [1] Tenant Name (ID: 1)
      [2] Another Tenant (ID: 2)
      [3] Third Tenant (ID: 3)

    Select tenant number (or press Ctrl+X to exit):

    ```
3. Enter the tenant number to select it
4. You're now in tenant context! Any command you run will execute within that tenant:

    ```
    tenant:Tenant Name> migrate
    tenant:Tenant Name> db:seed
    tenant:Tenant Name> tinker

    ```
5. To exit, type `exit` or press `Ctrl+X` (or `Cmd+X` on Mac)

### Example Session

[](#example-session)

```
$ php artisan tenant

Available Tenants:

  [1] Acme Corp (ID: 1)
  [2] Example Inc (ID: 2)

Select tenant number: 1

Entered tenant context: Acme Corp
Type 'exit' or press Ctrl+X to leave tenant context

tenant:Acme Corp> migrate
Running migrations...
tenant:Acme Corp> db:seed --class=UserSeeder
Seeding database...
tenant:Acme Corp> exit
Exited tenant context.
```

Features
--------

[](#features)

- ✅ Interactive tenant selection
- ✅ Automatic tenant context initialization
- ✅ All artisan commands work within tenant context
- ✅ No need to specify `--tenant` flag for each command
- ✅ Easy exit with `exit` command or `Ctrl+X`
- ✅ Supports multiple tenant packages
- ✅ Command history support (if readline is available)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Laravel &gt;= 10.0
- A tenant package (stancl/tenancy, spatie/laravel-multitenancy, or custom)

License
-------

[](#license)

MIT

Author
------

[](#author)

Xyorqin

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance51

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/29fe47ede13373ee3eb4abaf1a51513cf26177a2c14de5548560cbc606fb5132?d=identicon)[Xyorqin](/maintainers/Xyorqin)

---

Top Contributors

[![Xyorqin](https://avatars.githubusercontent.com/u/79446216?v=4)](https://github.com/Xyorqin "Xyorqin (2 commits)")

### Embed Badge

![Health badge](/badges/xyorqin-tenant-terminal/health.svg)

```
[![Health](https://phpackages.com/badges/xyorqin-tenant-terminal/health.svg)](https://phpackages.com/packages/xyorqin-tenant-terminal)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71470.5k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
