Download the PHP package binary-cats/laravel-tenant without Composer

On this page you can find all versions of the php package binary-cats/laravel-tenant. 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-tenant

A Simple Laravel Tenancy

https://github.com/binary-cats/laravel-tenant/actions https://github.styleci.io/repos/266611306 https://scrutinizer-ci.com/g/binary-cats/laravel-mailgun-webhooks/

This Laravel package allows you to drop-in multi-tenancy. It is a little opinionated and you are free to update and tinker with it.

What it does: Allows you to create a subdomain driven multi-tenant application where each tenant has a single, dedicated subdomain. Your models can be strictly tenantable, or shared between tenants. You are free to turn off subdomain routing.

Installation and Setup

This package requires PHP 7 and Laravel 5.6 or higher. Latest version requires PHP 7.2 and Laravel 7 and above.

THe package will register itself.

Resources

Publish all resources:

or, separately:

Configuration

Usage

To fully use Laravel Tenant you need to prepare your models and routing. Laravel Tenant will work best within authenticated environment; If you plan to use if for non-authenticated environment, I suggest creating a Service Provider resolving the tenant via TenantManager to prevent any data seeping.

Model Setup

Any model you expect to be scoped globally nees to:

  1. Have a foreign tenant key:
  2. Import Tenantable trait:

This will add a (Global scope)[https://laravel.com/docs/7.x/eloquent#global-scopes] and an automatic model observer, populating models with current tenant value.

Alternativesly, you can use an OptionalTenantable trait; it will scope for the exact match of the tenant key OR null value of the model tenant key. Use case scenario is when you have a shared set of models in addition to which the tenant may add their own. Think Gmail folders: Inbox and Trash are labels present in each user's mailbox; however, you are free to add more tags and they are visible only to you.

Caution

Do not include tenant_id into fillable attributes; it should be protected and, preferrably, hidden to make sure you do not accidentally expose tenant information.

Event Setup

Laravel Tenant provides automatic listeners you may hook up to streamline your app:

Subdomains

Laravel Tenant provides resolution logic for subdomains out of the box. If this functionailty is not needed, toggle config tenant.routing.autobind switch to false:

Testing

Run the tests with:

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Credits

Support us

Binary Cats is a web service agency based in Roselle, Illinois.

Does your business depend on our contributions? Reach out! All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

License

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


All versions of laravel-tenant with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
illuminate/support Version ^7.0|^8.0
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 binary-cats/laravel-tenant contains the following files

Loading the files please wait ....