Download the PHP package maize-tech/laravel-tenant-aware without Composer

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

# Laravel Tenant Aware [![Latest Version on Packagist](https://img.shields.io/packagist/v/maize-tech/laravel-tenant-aware.svg?style=flat-square)](https://packagist.org/packages/maize-tech/laravel-tenant-aware) [![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/maize-tech/laravel-tenant-aware/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/maize-tech/laravel-tenant-aware/actions?query=workflow%3Arun-tests+branch%3Amain) [![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/maize-tech/laravel-tenant-aware/php-cs-fixer.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/maize-tech/laravel-tenant-aware/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/maize-tech/laravel-tenant-aware.svg?style=flat-square)](https://packagist.org/packages/maize-tech/laravel-tenant-aware) Easily integrate single-database multi tenant features into your Laravel application. ## Installation You can install the package via composer: You can publish the config file with: This is the contents of the published config file: ## Usage ### Configuration Before getting started, make sure to fill in the `model` and `foreign_key_name` attributes under `config/tenant-aware.php`. Also, don't forget to define your own `TenantCurrentAction` and `TenantLandlordAction` actions in order to retrieve both the current and landlord tenants. For example, if you're using Spatie's [laravel-multitenancy](https://github.com/spatie/laravel-multitenancy) package your custom actions could look like this: ### Basic To use the package, add the `Maize\TenantAware\BelongsToTenant` trait to the models where you want to use the multi-tenant features. Remember all your multi-tenant models should have the tenant field specified in `foreign_key_name` attribute under `config/tenant-aware.php`. Once done, when querying any of your multi-tenant models you will only retrieve entities under your same tenant. Let's say, for example, we have this list of users in our database, and the currently authenticated user is part of the tenant `2`: | id | email | tenant_id | created_at | updated_at | |-----|--------------------|-----------|------------|------------| | 1 | [email protected] | 2 | // | // | | 2 | [email protected] | 2 | // | // | | 3 | [email protected] | 2 | // | // | | 4 | [email protected] | 3 | // | // | When querying the User model, you would only get the first three users: ### Querying global entities Have a model who should handle both global and tenant related entities? No worries! All you have to do is add the model class name to the `models.global` attribute under `config/tenant-aware.php`. Also, make sure your landlord tenant is returned on your custom `TenantLandlordAction` action class! Let's say you have an e-learning multi-tenant platform with both global courses and custom courses for each tenant. | id | name | tenant_id | created_at | updated_at | |-----|-------------------------|-----------|------------|------------| | 1 | Awesome global course A | 1 | // | // | | 2 | Awesome custom course B | 2 | // | // | | 3 | Awesome custom course C | 2 | // | // | | 4 | Awesome custom course D | 3 | // | // | That's what you would get when querying the Course model for a user under tenant `2`: ## Testing ## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Contributing Please see [CONTRIBUTING](https://github.com/maize-tech/.github/blob/main/CONTRIBUTING.md) for details. ## Security Vulnerabilities Please review [our security policy](https://github.com/maize-tech/.github/security/policy) on how to report security vulnerabilities. ## Credits - [Enrico De Lazzari](https://github.com/enricodelazzari) - [All Contributors](../../contributors) ## License The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

All versions of laravel-tenant-aware with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/database Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.14.1
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 maize-tech/laravel-tenant-aware contains the following files

Loading the files please wait ....