Download the PHP package misaf/vendra-tenant without Composer

On this page you can find all versions of the php package misaf/vendra-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 vendra-tenant

Vendra Tenant

A generic multi-tenancy engine for Laravel applications, built on Spatie Laravel Multitenancy.

Tenant is a technical role, not a business entity. This package owns the mechanism — current tenant context, resolution, switching, isolation — and never the model that plays the role. That model is yours: Vendra ecommerce points it at a Store, another application points it at a Company, Workspace, Organization or Team.

Installing this package activates tenant awareness across domain packages by binding the shared Misaf\VendraSupport\Contracts\TenantResolver contract to ConfiguredTenantResolver. Domain packages stay coupled only to misaf/vendra-support, and this package depends on no business domain at all — there is an architecture test that says so.

Features

Requirements

Installation

Choosing the tenant model

Your tenant is any Eloquent model that implements Misaf\VendraTenant\Contracts\TenantContract. Extending Spatie's base tenant is the shortest route to the IsTenant half of the contract, and the IsTenantModel concern supplies the rest from name and slug columns:

A tenant that carries locale or timezone columns has them applied while it is the current tenant — the concern reads them, and a tenant model without those columns simply keeps the application's own configuration.

Point the engine at it in config/vendra-tenant.php:

That is the whole wiring. Tenant-scoped models now stamp and scope themselves by company_id, and $document->tenant resolves to a Company:

Vendra's own wiring is the same two keys pointed at Misaf\VendraStore\Models\Store. Vendra deliberately keeps foreign_key as the neutral tenant_id, so every reusable domain package (products, blog_posts, roles) works unchanged under any tenant model; only records describing the Store itself carry store_id, and those belong to misaf/vendra-store.

The relation stays tenant() rather than gaining a business alias: an alias would have to be registered into Eloquent's process-wide relation resolvers at model-boot time, which makes a model's API depend on whichever configuration was loaded when its class first booted. Domain code reads $product->tenant, and in Vendra that is the Store.

Resolving tenants from hosts

Host-to-tenant mapping is business knowledge — it needs a domains table this package does not own — so the engine depends on a port and the application binds the adapter:

Without a binding, NullHostTenantFinder resolves nothing. In Vendra, misaf/vendra-store binds StoreDomainFinder.

config/vendra-tenant.php derives central_host from APP_URL. The registered GET /caddy/domain-check?domain=… route authorizes only hosts the bound finder recognises, and only accepts loopback requests; expose it to Caddy through the local reverse proxy, not directly to the public internet.

Enabling tenancy after domain migrations

If domain packages were migrated before this provider was installed, create the tenant that should own the existing records and run:

The command consumes the tenant table registry, adds the configured foreign key and its index on the registered connections, assigns unscoped records to the selected tenant, and can be rerun safely. Interactive confirmation is enabled by default; use --force only for intentional non-interactive deployment.

Generate isolated route caches for every tenant with:

Testing

Run the package checks from the project root:

The suite drives the engine through a Workspace fixture rather than through Vendra's Store — a model with a different name, table and foreign key — so a business assumption leaking back into this package fails a test.

License

MIT. See LICENSE.


All versions of vendra-tenant with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/console Version ^13.0
illuminate/contracts Version ^13.0
illuminate/database Version ^13.0
illuminate/support Version ^13.0
misaf/vendra-support Version self.version
spatie/laravel-multitenancy Version ^4.1.3
spatie/laravel-package-tools Version ^1.93.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 misaf/vendra-tenant contains the following files

Loading the files please wait ...