All Projects → yanhao-li → office-building

yanhao-li / office-building

Licence: MIT license
🏢 Easy to use SaaS Multitenancy solution for Laravel

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to office-building

sails-hook-multitenant
A multitenant Sails.js 1.X hook for Waterline ORM.
Stars: ✭ 15 (-28.57%)
Mutual labels:  multitenancy, multitenant
detectify
Detectify is a gem for multi-tenant Rack apps, to help you retrieve domain and subdomain-related data from a database.
Stars: ✭ 79 (+276.19%)
Mutual labels:  multitenancy, multitenant
multitenant-microservices-demo
Full Isolation in Multi-Tenant SaaS with Kubernetes + Istio
Stars: ✭ 57 (+171.43%)
Mutual labels:  multitenancy, multitenant
react-native-multitenant-boilerplate
No description or website provided.
Stars: ✭ 27 (+28.57%)
Mutual labels:  multitenancy, multitenant
grandnode2
Free, Open source, Fast, Headless, Multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, LiteDB, Vue.js.
Stars: ✭ 626 (+2880.95%)
Mutual labels:  multitenancy, multitenant
Iot Technical Guide
🐝 IoT Technical Guide --- 从零搭建高性能物联网平台及物联网解决方案和Thingsboard源码分析 ✨ ✨ ✨ (IoT Platform, SaaS, MQTT, CoAP, HTTP, Modbus, OPC, WebSocket, 物模型,Protobuf, PostgreSQL, MongoDB, Spring Security, OAuth2, RuleEngine, Kafka, Docker)
Stars: ✭ 2,334 (+11014.29%)
Mutual labels:  multitenant
multitenancy
A laravel package to provide multi-tenancy support
Stars: ✭ 20 (-4.76%)
Mutual labels:  multitenancy
springboot-schema-per-tenant
Seed for achieving multi-tenancy (single pooled schema-per-tenant) using SpringBoot and Hibernate
Stars: ✭ 75 (+257.14%)
Mutual labels:  multitenant
pg rls
PostgreSQL Row Level Security, The Rails right way to do multitenancy
Stars: ✭ 104 (+395.24%)
Mutual labels:  multitenancy
kibana-multitenant-proxy
A proxy behind nginx while before kibana (4.x, 5.x) to provide data isolation for different users
Stars: ✭ 25 (+19.05%)
Mutual labels:  multitenant
cortex
📝 A headless, multitenant dynamic content platform powered by Rails, GraphQL and Elasticsearch
Stars: ✭ 28 (+33.33%)
Mutual labels:  multitenant
Frappe
Low code web framework for real world applications, in Python and Javascript
Stars: ✭ 3,349 (+15847.62%)
Mutual labels:  multitenant
Bouncer
Eloquent roles and abilities.
Stars: ✭ 2,763 (+13057.14%)
Mutual labels:  multitenancy
IoT-Technical-Guide
🐝 IoT Technical Guide --- 从零搭建高性能物联网平台及物联网解决方案和Thingsboard源码分析 ✨ ✨ ✨ (IoT Platform, SaaS, MQTT, CoAP, HTTP, Modbus, OPC, WebSocket, 物模型,Protobuf, PostgreSQL, MongoDB, Spring Security, OAuth2, RuleEngine, Kafka, Docker)
Stars: ✭ 2,565 (+12114.29%)
Mutual labels:  multitenant
Multitenancy-Microservice-FederatedIdentity-Example
Multitenancy Federated Identity Example ASP.NET MVC C#
Stars: ✭ 33 (+57.14%)
Mutual labels:  multitenancy
dotnet-webapi-boilerplate
Clean Architecture Template for .NET 6.0 WebApi built with Multitenancy Support.
Stars: ✭ 2,200 (+10376.19%)
Mutual labels:  multitenancy
capsule-lens-extension
Lens Extension for Capsule Operator - Looking for a maintainer
Stars: ✭ 37 (+76.19%)
Mutual labels:  multitenancy
cloud-cap-multitenancy
SAP Cloud Application Programming Model (CAP) sample code project with multitenancy using service manager-created SAP HANA containers for tenant data isolation.
Stars: ✭ 33 (+57.14%)
Mutual labels:  multitenancy
kcp
kcp is a Kubernetes-like control plane for workloads on many clusters
Stars: ✭ 1,881 (+8857.14%)
Mutual labels:  multitenancy
Tenancy
Automatic multi-tenancy for Laravel. No code changes needed.
Stars: ✭ 2,133 (+10057.14%)
Mutual labels:  multitenancy

Office Building

Travis license PRs Welcome

Office Building is an easy to use Laravel package to help you build the Multi-tenant SaaS with database-per-tenant. Support Laravel 5.3+

Installation

Install Office Building via Composer:

composer require yanhaoli/office-building

For laravel >= 5.5 that's all, thanks to Package Discovery.

For laravel <= 5.5, you have to add Yanhaoli\OfficeBuilding\Providers\OfficeBuildingServiceProvider to your config/app.php providers array:

Yanhaoli\OfficeBuilding\Providers\OfficeBuildingServiceProvider::class,

Usage

  1. Config the basis Firstly you have to publish the config file with the following command:

    php artisan vendor:publish --provider="Yanhaoli\OfficeBuilding\Providers\OfficeBuildingServiceProvider"

    Now checkout config/officebuilding.php and modify it by your needs.

  2. Open a new Office for your customer

    <?php
    
    namespace App\Http\Controller;
    use OfficeBuilding;
    use App\Company;
    
    class CompanyController extends Controller
    {
      public function create(Request $request)
      {
        $company_name = $request->input('name');
        $database_name = OfficeBuilding::addOffice($company_name);
        $company = new Company;
        $company->name = $company_name;
        $company->database_name = $database_name;
        $company->save();
        return response('created', 201);
      }
    }
  3. Handle request for a specific office. Ex, Get all employees of that office

    use OfficeBuilding::visit method to switch database connection to a specific office, with a callback method to handle request, the connection will be revert to the previous status after task completed.

    <?php
    
    namespace App\Http\Controller;
    use OfficeBuilding;
    use App\OfficeBuilding\Employee;
    
    class OfficeEmployeeController extends Controller
    {
      public function browse(Request $request, $office_id)
      {
        $employees = OfficeBuilding::visit($office_id, function(){
          return Employee::all();
        });
    
        return response($employees, 200);
      }
    }

Contributing

Welcome any contributions for issue fix or functionality improvement.

Security Vulnerabilities

If you discover a security vulnerability , please shot me an email at [email protected].

License

The MIT License (MIT). Please see MIT license for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].