"Tenancy for Laravel" - Quickstart - does not return the page
Since I had the task to build an app multi tenants I was looking around for the eventually modules, plugins or tutorials already popular in the web.
After reading the documentation I finally jumped into Tenancy for Laravel, something looked very solid and more appealing than all the other alternatives out there.
So I just wanted to check the Quickstart in the documentation and apparently due of my probable limitation this quickstart does not work to me.
I use XAMPP for all my project in PHP, because I'm native of .NET.
Said this, I followed every point of the Quickstart using a fresh Laravel 11 installation.
Unfortunately the output when I switch to one of the secondary domain as described in the quickstart (foo, bar), is always the same laconic DNS_PROBE_FINISHED_NXDOMAIN page, thus not reaching the secondary domain. The central domain instead works like a charm.
Since I use XAMPP this is my configuration of the VHOST:
<VirtualHost *:80>
DocumentRoot "path-to-the-public-directory-of-laravel"
ServerName tenancy.test
ServerAlias *.tenancy.test
ServerAlias foo.tenancy.test
<Directory "path-to-the-public-directory-of-laravel">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Options All
Require all granted
</Directory>
</VirtualHost>
As usual I also added the central domain to my hosts
127.0.0.1 tenancy.test
Starting from the assumption that is something I miss and the quickstart it should works, there are some grey areas when using tinker you create the tenants:
$ php artisan tinker
>>> $tenant1 = App\Models\Tenant::create(['id' => 'foo']);
>>> $tenant1->domains()->create(['domain' => 'foo.localhost']);
>>>
>>> $tenant2 = App\Models\Tenant::create(['id' => 'bar']);
>>> $tenant2->domains()->create(['domain' => 'bar.localhost']);
I tried with both bar.tenancy.test and localhost because looked to me a little weird to create the domain as (ex.) "foo.localhost".
Well so far not so good. Is there maybe a pious soul that was able to run the quickstart successfully and can maybe reading catch something I missed?
I'm at total disposal for further info.
Please or to participate in this conversation.