I'm creating a website in which I want an admin panel and a panel for schools. This second panel should be available trough "school.{DOMAIN}". Currently, these are two separate projects that both have the same models and migrations, but I have to add/change the files in both projects when I change a model, notification or something else.
This means that development can be very annoying because I have to copy/paste files between projects. This is why I'm interested in Laravel subdomain routing. However, the more I read into this method, the more I am starting to think Laravel subdomain routing isn't quite a finished project yet. I've got a few questions:
1: How should I add the subdomain to my Routes, I currently have
protected function mapSchoolRoutes()
{
Route::domain('school.lvh.me')
->namespace($this->namespace)
->group(base_path('routes/school.php'));
}
in my RouteServiceProvider.php file, but this way when I deploy to production, it is still only responding to requests to .lvh.me (which doesn't work, because this isn't the domain).
2: Can I use separate login/register pages for my subdomain? Currently, when I add Auth::routes() to my routes/school.php file, it goes to the default views (views/auth/login.php) instead of the right files (views/school/auth/login.php).
3: Is Laravel subdomain development "mature" enough? Or is there a better way for me to develop the main domain and a subdomain?