Download the PHP package angelitosystems/filament-tenancy without Composer

On this page you can find all versions of the php package angelitosystems/filament-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 filament-tenancy

Filament Tenancy

A comprehensive multi-tenancy package for Filament with support for multiple databases, central management, advanced logging, and performance monitoring.

Features

Installation

Quick Install

The easiest way to install Filament Tenancy is using the interactive installer:

The installer will:

Manual Installation

If you prefer manual installation:

Central Database Setup

After installation, you need to set up the central database with roles and permissions for the landlord/central administration:

The central database setup includes:

Central Permissions Available:

Requirements

Configuration

The package configuration is located at config/filament-tenancy.php. Key configuration options include:

Tenant Resolution

Note: The package now supports APP_DOMAIN environment variable for subdomain-based tenancy. When creating tenants with subdomains, the package will automatically detect and suggest configuring APP_DOMAIN from your APP_URL if it's not already set.

Database Configuration

Environment Variables

The package uses the following environment variables:

APP_DOMAIN: This variable is automatically detected and configured when creating tenants. If your APP_URL contains a valid domain (e.g., http://hola.test), the package will ask if you want to use it as APP_DOMAIN. This is essential for subdomain-based tenancy.

Central Domains: APP_DOMAIN is automatically considered a central domain and will not resolve tenants. Additional domains can be configured in central_domains config array. Central domains typically host the admin panel for managing tenants. The middleware automatically allows access to these domains without tenant resolution.

Security: The middleware automatically:

Filament Integration

Usage

Creating Tenants

Using Artisan Commands (Interactive)

The easiest way to create tenants is using the interactive command:

The command will guide you through:

APP_DOMAIN Auto-Configuration:

Creating Tenant Users

Create users for specific tenants with roles and permissions:

Features:

Using Artisan Commands (Non-Interactive)

Note: When using --plan, the plan slug must exist in the tenancy_plans table. If a plan is provided, a subscription will be automatically created for the tenant.

Programmatically

Working with Models

User Model with Roles & Permissions

Add the HasRoles trait to your User model to enable role-based access control:

Using Roles and Permissions

Asset Sharing

Use the tenant_asset() helper to access shared assets:

The helper automatically:

  1. Checks for the asset in the tenant's storage disk
  2. Falls back to the central storage disk if not found
  3. Uses Laravel's asset() helper as final fallback

Tenant Models

For models that belong to tenants, use the BelongsToTenant trait:

Central/Landlord Models

For models that should always use the central database, use the UsesLandlordConnection trait:

Filament Panel Configuration

Landlord Panel

Create a landlord panel for managing tenants:

Tenant Panel

Create a tenant panel:

Middleware

The package provides several middleware for tenant management:

Custom 404 Page

The package includes a beautiful, personalized 404 page for tenant not found errors. During installation, you'll be asked if you want to publish the components and views for customization.

Publishing Components

Published Files

If you choose to publish during installation:

Customization

Once published, you can fully customize:

Automatic Registration

The installer automatically registers the custom 404 page in bootstrap/app.php (Laravel 11) for handling tenant not found errors. The page will:

Without Publishing

If you choose not to publish, the package will use its internal views and components. The 404 page will still work, but you won't be able to customize it.

Database Migrations

Running Tenant Migrations

Creating Tenant-Specific Migrations

Place tenant-specific migrations in database/migrations/tenant/:

Events

The package dispatches several events:

Advanced Usage

Custom Tenant Resolution

You can extend the tenant resolver for custom logic:

Custom Database Configuration

Override database configuration per tenant:

Tenant Data Storage

Store additional tenant data using the JSON data column:

APP_DOMAIN Configuration

The APP_DOMAIN environment variable is used for subdomain-based tenancy. It's automatically detected and configured during tenant creation:

Automatic Detection:

Manual Configuration:

Usage:

Example:

Testing

Run the package tests:

Debug Logging

The package includes enhanced debug logging that is environment-aware:

DebugHelper Class

The DebugHelper class provides environment-aware logging:

Environment Configuration

Log Behavior

Security

This package includes several security features:

Contributing

Please see CONTRIBUTING.md for details.

License

This package is currently available for public use, but will transition to a license-based distribution model in the future.

โš–๏ธ License Terms & Usage Rights

Current Status: Public Access (Temporary)

๐Ÿ”ฎ Future Licensing Model

Important: This package will transition to a paid license model in the future. Users who adopt the package now will receive preferential treatment when licensing becomes available.

โš ๏ธ What Happens If You Violate the License?

Legal Consequences:

Technical Consequences:

๐Ÿ“„ License Compliance

To ensure compliance:

Current License: MIT License (subject to above restrictions)

For complete license terms, please read the LICENSE file.

Available Commands

Central Database Commands

Tenant Management Commands

Migration Commands

Monitoring Commands

Documentation

Additional Guides

Credits

Support

For support, please open an issue on GitHub or contact us at [email protected].


All versions of filament-tenancy with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
laravel/framework Version ^11.0|^12.0
filament/filament Version ^4.0
filament/forms Version ^4.0
filament/tables Version ^4.0
barryvdh/laravel-dompdf Version ^3.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 angelitosystems/filament-tenancy contains the following files

Loading the files please wait ...