Download the PHP package aventure-cloud/laravel-tenancy without Composer

On this page you can find all versions of the php package aventure-cloud/laravel-tenancy. 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 laravel-tenancy

Laravel Multi Tenancy

Latest Stable Version Total Downloads License

Single database Multi-Tenancy solution for Laravel applications.

Installation

composer require aventure-cloud/laravel-tenancy

After installation you don't need to add MultiTenancyServiceProvider in your configuration because it's auto-discovered from Laravel.

Configuration

To get full control of the package's behavior you need publish config/multitenancy.php file.

php artisan vendor:publish --provider="AventureCloud\MultiTenancy\MultiTenancyServiceProvider"

Eloquent Model Traits

Attach BelongsToTenant trait to models that you want scope by tenant:

Add IsTenant trait to your eloquent model that represent the tenant entity in your app:

Configuring multi-tenant routes

You need to wrap all routes with tenant dependency before applying any other middleware. You can use the routes method by our facade that handle tenant recognition process automatically for you.

Default routes

Your landing page need to be loaded under your personal url, so you need to tell to the laravel how to identify your general routes. In your RoutesServiceProvider you can modify your map method like:

Validation Rules

Scoping your application by tenant can cause wrong behavior of the unique and exists validation rules that performs a query on the database without considering tenant scope by default.

This package ships with extended version of these two rules that run a query filtered by tenant.

Queue

One drawback of sending Jobs into the Queue is that these are executed in a completely different process depending on your queue configuration including redis and beanstalk.

In order to assist you with tenant aware jobs, a TenantAwareJob is available to you. Instead of applying the SerializesModel trait as per suggestion in the Laravel documentation, you should use this Trait instead.

Events

When a tenant is founded and stored in Tenancy service the package fire an event with attacched tenant instance:

LICENSE

This package are licensed under the MIT license.


All versions of laravel-tenancy with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
illuminate/support Version 5.*
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 aventure-cloud/laravel-tenancy contains the following files

Loading the files please wait ....