Download the PHP package appstract/laravel-multisite without Composer

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

Laravel Multisite

Latest Version on Packagist Total Downloads Build Status

With this package it is possible to build multiple sites/(sub)domains on one codebase.

Installation

You can install the package via composer:

Config (hosts, homestead)

You need to add the sites to your /etc/hosts file and Homestead.yaml. For example, mywebsite.dev and blog.mywebsite.dev. In the Homestead.yaml, you need to map the sites to the same folder.

Publish

By running php artisan vendor:publish --provider="Appstract\Multisite\MultisiteServiceProvider" in your project all files for multisite will be published. The files that will be published are: a migration, a seeder and a config file.

Seeder

The seeder will be published but needs to be run when running php artisan db:seed, so you need the add $this->call(SitesTableSeeder::class); to your DatabaseSeeder.php file. After migrating and seeding the sites are now present in the database.

Usage

This is the main part, within your routes/web.php you can set routes for your sites within route groups, like this:

The magic happens with the site middleware site:blog. This will tell your app that the routes within the group are belonging to the blog. It will provide a variable called $currentSite in all your views. There is also a config available, which you can access with Config::get('multisite.site').

Testing

Contributing

Contributions are welcome, thanks to y'all :)

About Appstract

Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on Medium. You can follow us on Twitter, buy us a beer or support us on Patreon.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-multisite with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 appstract/laravel-multisite contains the following files

Loading the files please wait ....