PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved
Solved
francescomulassano1

Nov 25th, 2022 05:01 AM

Hi! I'm new to Wave, i also have subscribed the proplan and digging inside wave to make my own saas application. I have eperience with winter cms developing and i found it's quite similar.

But i need to implement a multi tenancy in order to have one subdomain for each subscriber.

Can someone has implemented a thing like this? Thanks

bobbyiliev

Nov 25th, 2022 07:53 AM

Hi there,

Wave uses Voyager as its admin panel. As of the time being, this is something that Voyager does not offer out of the box.

However there is a work around that you could follow here:

How to apply multi-tenancy in Laravel Voyager

Hope that this helps!

Best,

Bobby

francescomulassano1

Nov 25th, 2022 11:30 AM

I found this guide today, need to try. Partially solve but I need to create subdomains per user

bobbyiliev

Nov 26th, 2022 11:13 PM

That should not be a problem, you could just use the standard Laravel subdomain routing functionality:

Subdomains may be assigned route parameters just like route URIs, allowing you to capture a portion of the subdomain for usage in your route or controller. The subdomain may be specified by calling the domain method before defining the group:

Route::domain('{account}.example.com')->group(function () {
    Route::get('user/{id}', function ($account, $id) {
        //
    });
});

In order to ensure your subdomain routes are reachable, you should register subdomain routes before registering root domain routes. This will prevent root domain routes from overwriting subdomain routes that have the same URI path.

For more information you could check out the docs here:

Subdomain Routing

Let me know if you have any questions!

francescomulassano1

Nov 27th, 2022 02:27 PM

thank you @bobby, i will investigate this!

francescomulassano1

Nov 28th, 2022 01:26 AM

Best Answer

Ok, solved (in my dev env made with ddev) with this piece of code

Route::group(array('domain' => '{subdomain}.mysite.ddev.site'), function () {
    Route::get('/', function ($subdomain) {
        $name = DB::table('users')->where('username', $subdomain)->get();
        return $name;
    });
});
Report
2
bobbyiliev

Nov 28th, 2022 06:29 AM

That is great! Happy to hear that you've got it working!