Download the PHP package bvharen/laravel-subdomain without Composer

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

Associate models to dynamic subdomains in laravel

Easily setup dynamic subdomains registered to models on your application e.g company1.myapp.com

Installation

You can install this package via composer by

*In Laravel 5.5 and below add this to your providers and aliases array

Then run php artisan vendor:publish to publish the configuration file

Config

The config/subdomains.php file:

Once you have published the package, you can then set the configuration to your application's setup

Usage

After setting up your routes to catch subdomains e.g

Make sure all controller assigned to subdomains extend the \kofoworola\Subdomains\Controller\SubdomainController class:

The parent controller automatically removes the subdomain parameter from list of paremeters so you don't have to add it to you parameter list everytime you want to get another parameter

Facade

Using the kofoworola\Subdomains\Facade\Subdomains facade you can access helper functions:

Getting the name of the parameter

Use Subdomains::name() to get the name of the subdomain parameter

Getting the value of the subdomain

Use Subdomains::value() to get the value of the subdomain parameter

Getting the owner of the subdomain

Use Subdomains::owner() to get the model instance that owns the current subdomain

Checking if the user has access to the subdomain

Subdomains::ownsModel($user = null) returns true or false depending on whether the user has access to the subdomain

If no user is passed the current logged in user is used

Getting a subdomain route

Can be used to generate a subdomain link

Middleware

You can also add the \kofoworola\Subdomains\Middleware\HasSubdomain middleware to your routes. Firstly register it in your Kernel:

Then add it to your routes:

The middleware will take care of verifying if:


All versions of laravel-subdomain with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3|^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 bvharen/laravel-subdomain contains the following files

Loading the files please wait ....