Code Monkey home page Code Monkey logo

tenanter's Introduction

Larabeans > Tenanter


Tenanter

Apiato container to add multi tenancy feature


Overview

  • Add functionality to manage multi-tenancy, create/add/edit
  • Add functionality to activate/de-activate tenant account.
  • Updates existing database structure to make it compatible with multi-tenant application

Migrations

Includes migration to add tenant_id column in all existing database tables.


Seeders

For seeder naming use post fix from _1 to _10

Includes seeders for

  • tenant roles
  • tenant permissions
  • root admin
  • tenant admin
  • default root admin
  • default tenant admin
  • default tenant

USAGE

  • Use HasTenancy traits in User, Roles, ParentModel in core/beanner ( or your own recpective models accordingly)

  • Use Authentication Trait in User modes on core/beanner ( or your own recpective models accordingly)

  • In User container we need to modify two requests, email validation rules as give below

    • \app\Containers\AppSection\User\UI\API\Requests\RegisterUserRequest.php
    • \app\Containers\AppSection\User\UI\API\Requests\CreateAdminRequest.php

    'email' => 'required|email|max:40|unique:users,email,NULL,id,tenant_id,' . tenant()->getTenantKey(),

  • Update role name validation rule in AppSection/Authorization/UI/API/Requests/CreateRoleRequest.php as below 'name' => 'required|unique:' . config('permission.table_names.roles') . ',name,NULL,id,tenant_id,' . tenant()->getTenantKey() . '|min:2|max:20|no_spaces',


TODO

  • Implement cli (artisan) command to add tenant column to any table (specifying table name and column type i.e. incement or uuid)
  • Implement cli (artisan) command to add default tenant in database
  • Remove CLI command Add TennatIdToTablesCommand
  • Remove CLI command from confugurationer comtainer to add host configuration (it is already handled here
  • Remove use of host_domains from tenanter config

Larabeans > Tenanter โฌ†

tenanter's People

Contributors

naqvi-sajjad avatar smurtazakazmi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.