Download the PHP package multiplier/laravel-tenant-subdomain without Composer

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

Laravel Tenant Subdomínio

Este pacote irá auxiliar na organização de clientes em subdomínios usando Laravel.

Instalação

Execute em seu terminal

adicione o provider e o facade em config/app.php:

adicione o middleware em app/Http/Kernel.php

Após isso, abra seu console e execute: php artisan vendor:publish, modifique o arquivo config/tenant.php para sua necessidade, abra seu arquivo .env e adicione:

Uso

para gerar rotas de subdominio, utilize da seguinte forma:

para gerar rotas para a aplicação principal (que não seja subdominio), utilize da seguinte forma

Carregando as configurações de banco de acordo com o subdominio

os arquivos de configurações de banco serão lidos por padrão, dentro da pasta config/tenant, com o exemplo de conteudo:

o arquivo é lido e adicionado como conexão padrão tenant, isso é feito via Middleware, em todas as rotas que irão utilizar base de dados própria, use o middleware tenant.database:

Supondo que o usuário acesse http://beltrano.domain.com, a configuração a ser carregada deverá estar em /config/tenants/beltrano.php (isso é configurável)

Criar configurações de banco

Para criar uma nova configuração de banco, use da seguinte forma:

isso irá gerar um arquivo dentro de config/tenants com o nome de foo.php (ou como/onde for definido na configuração), com o seguinte conteúdo

Excluir configurações de banco

Para excluir um arquivo de configuração, apenas execute da seguinte maneira:


All versions of laravel-tenant-subdomain with dependencies

PHP Build Version
Package Version
Requires illuminate/routing Version 7.*
illuminate/config Version 7.*
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 multiplier/laravel-tenant-subdomain contains the following files

Loading the files please wait ....