question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Routes within a domain group do not work correctly

See original GitHub issue

Missing Protocol

When using routes in a domain group, the domain is added by the js route() function, but there is no protocol attached, so the url returned is incorrect.

in web.php

Route::domain('example.org')->group(function() {
	Route::get('/help', function () { 
			return 'help'; 
		})
		->name('help');
});

in blade/js

route('help'); 
// returns 'example.org/help' 
//     instead of '//example.org/help' 
//             or 'http://example.org/help'

Missing Port

Another thing is that if Laravel is running under example.org:81 the php route() function adds the :81 to the url, if its the current domain.

If the current URL is ‘http://example.org:81/home

dump(route('help'));
// returns 'http://example.org:81/help'

but in JS

route('help'); 
// returns 'example.org/help' 
//     instead of '//example.org:81/help' 
//             or 'http://example.org:81/help'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ThomasEnssnercommented, Oct 10, 2017

Thanks for the merge

0reactions
ThomasEnssnercommented, Sep 29, 2017

sorry i am a little bit under load at the moment, maybe can have a look this weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Domain Route Group not working - Laracasts
I have the following code: Route::group(['domain' => '{account}.domain.tld'], function () { Route::get('/{name?}', function ($account , $name = 'lionel') ...
Read more >
Laravel Route::group[] not working correctly - Stack Overflow
I am expecting to see in names admin.index, admin.another,... However, if I use the Route::name function, it will work correctly. Route ...
Read more >
Routes with domains are serving the wrong controller #73
Issue: Because Laravel processes routes on a first-come-first-serve basis, if you have routes with the same URI on different domains, it doesn't matter ......
Read more >
How To Set Up Routing and Remote Access - Windows Server
In this article. Summary. This article describes how to set up routing and remote access for an Intranet. Applies to: Windows Server 2012...
Read more >
Troubleshoot and Solve Domain-Join Problems - BeyondTrust
Solve Domain-Join Problems · Verify that the Name Server Can Find the Domain · Make Sure the Client Can Reach the Domain Controller...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found