承接 sadeghpm/xshop-multitenancy 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sadeghpm/xshop-multitenancy

最新稳定版本:v1.0

Composer 安装命令:

composer require sadeghpm/xshop-multitenancy

包简介

README 文档

README

multitenancy support for xShop

xShop Multitenancy Package

Note

This package provides multitenancy support for xShop, facilitating the management of multiple tenant databases.

New Features

  • Database creation for each tenant.
  • Tenant-specific migrations and seeders.
  • Automatic admin user creation for tenants.

Installation

To install the package, follow these steps:

composer require sadeghpm/xshop-multitenancy

Multitenancy Setup

Initial Setup

Run the multitenancy:setup command to configure multitenancy:

php artisan multitenancy:setup

Change Database config

Add the following line to your config/database.php file:

        'landlord'=>[
            'driver' => 'sqlite',
            'database' => database_path('tenant-db.sqlite'),
            'prefix' => '',
        ],
        'tenant'=>[
            'driver' => 'sqlite',
            'database' => null,
            'prefix' => '',
        ],

Set active connection to tenant in .env file:

DB_CONNECTION=tenant

Adding Tenants

To add new tenants, use the multitenancy:create-tenant command:

php artisan multitenancy:create-tenant

This command will:

  1. Ask for the tenant's name and domain.
  2. Create the tenant in the database.
  3. Prompt for admin user details and create the admin user for the new tenant.

Commands Summary

  • multitenancy:setup: For initial configuration and creating the first tenant.
  • multitenancy:create-tenant: For adding new tenants.
  • multitenancy:list-tenants : To list all tenants.

Developed With Love! ❤️

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-11-25