Download the PHP package 16bit/easy-multitenancy without Composer

On this page you can find all versions of the php package 16bit/easy-multitenancy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package easy-multitenancy

Easy Multitenancy for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A simple, drop-in Laravel package for database-per-tenant multitenancy using SQLite. Perfect for SaaS applications where each tenant gets their own isolated SQLite database with automatic URL-based tenant identification and seamless database switching.

Installation

You can install the package via composer:

Publish the config file:

This is the contents of the published config file:

Features

Usage

Creating a Tenant

Listing Tenants

Running Migrations

Seeding Databases

Accessing Tenants in Code

The package automatically identifies tenants from the URL and switches the database context. All routes are automatically prefixed with {tenant} parameter.

Events

The package dispatches several events you can listen to:

Central (Landlord) Connection

Some data is shared across all tenants (e.g. the list of tenants, global users, billing). Enable the optional central connection to keep the landlord database reachable even while a tenant connection is active:

When enabled, a central connection is registered pointing at your application's default connection as configured at boot. Add the UsesCentralConnection trait to any model that must always query the central database, regardless of the current tenant:

Storage note: when storage isolation is enabled the package routes the default filesystem disk to a per-tenant directory (and registers a tenant disk). Calls that target the default disk are tenant-scoped; explicit Storage::disk('local') calls are not.

Central Routes

Declare landlord routes that must never be tenant-prefixed (marketing pages, tenant sign-up, the landlord dashboard) with Tenant::centralRoutes():

These routes keep their original URI (no {tenant}/ prefix), run on the default/central connection, and are skipped by tenant identification.

Recently Visited Tenants

Enable track_recent_tenants to keep a per-browser list of recently visited tenants in a shared cookie. Read it (typically from a central route) with Tenant::getRecentTenants():

Queued Jobs

When queue.tenant_aware is enabled (default), the current tenant is automatically injected into every queued job at dispatch and restored before the job runs — no trait required. Opt a job out of tenant context by implementing the GlobalJob interface, listing it under queue.excluded_jobs / queue.excluded_patterns, or setting a public $tenantAware = false property:

Route Configuration

By default, all routes are automatically prefixed with the tenant parameter. You can exclude specific routes:

Generating URLs

The package includes a custom URL generator that automatically includes the tenant parameter:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

If you discover a security vulnerability, please email Mattia Trapani at [email protected].

Credits

License

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


All versions of easy-multitenancy with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^12.0||^13.0
illuminate/contracts Version ^12.0||^13.0
illuminate/database Version ^12.0||^13.0
illuminate/routing Version ^12.0||^13.0
illuminate/support Version ^12.0||^13.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package 16bit/easy-multitenancy contains the following files

Loading the files please wait ...