Git Product home page Git Product logo

multi-domain-laravel's Introduction

๐Ÿ”ฅ UPDATE

A better example with online demo: https://github.com/laravel-101/multi-domain-laravel-app

Multi-Domain Laravel App

An example of multi-domain/subdomain app in Laravel. A project allows your users to create their shops (or websites) under your subdomain, like acme.example.com

laravel-multi-domain

What's included?

  • User login and registration
  • Application control panel
  • Sub-domains routes
  • Custom helper functions to work with subdomains
  • Database migrations
  • etc.

Please note: This is a demo project, and a lot of features aren't included, such as billing, user management, etc. The main purpose of this project is to show how to work with wildcard domains/subdomains in Laravel Framework.

Learn more

Read more about this project here: https://maxkostinevich.com/blog/multi-domain-laravel

Deployment

It is supposed that the project is hosted using Laravel Forge and deployed using Envoyer.io

Commands to be added after installing composer dependencies:

cd {{release}}

composer update

npm install
npm run production

php artisan view:clear
php artisan cache:clear
php artisan vendor:publish
php artisan migrate --force

php artisan db:seed --force

php artisan config:cache

Notes

Setting up .env file

Let's assume the app will be running on the app.example.com domain, so your users will be able to create their shops on your sub-domains, like acme.example.com. In this case, your .env file may looks as follow:

APP_URL=http://app.example.com
APP_DOMAIN=app.example.com

SESSION_DOMAIN='.example.com'

ADMIN_FIRST_NAME=John
ADMIN_LAST_NAME=Doe
[email protected]
ADMIN_PASSWORD=my_secure_password

Development on local environment

It is recommended to use tunneling service like ngrok.com, when developing on your local machine. In this case your .env file may looks as follow:

APP_URL=http://app.yourapp.ngrok.io
APP_DOMAIN=yourapp.ngrok.io

SESSION_DOMAIN='.yourapp.ngrok.io'

ADMIN_FIRST_NAME=John
ADMIN_LAST_NAME=Doe
[email protected]
ADMIN_PASSWORD=secure_pa55word

Available NPM commands

npm run watch
npm run dev
npm run production

Changelog

v1.0.0 - May 25, 2018
** Initial release **

Credits

(c) 2018 DigitalWheat - All rights reserved.

About

At DigitalWheat we create modern web-applications for small and medium-sized business.

Have a project in mind? Let's talk!

multi-domain-laravel's People

Contributors

maxkostinevich avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.