No one seems to hit this problem, as there no questions on it online.
When i do something like
<a href="{{ $client->client_url }}" class="btn btn-default">Go back to {{ $client->client_name }} homepage></a>
Laravel istead of taking the user to say
http://www.client_website.com
it does something like
http://myApp/http://www.client_website.com
Any ideas are much appreciated.
You must be saving client_url
as full URL. I.e: http://www.client_url.com
So this way it will not append to your url. but rather open client url.
And one suggestion: Add _target="blank" to your <a>
tag, this open new tab instead of loading on the same tab and override your own site.
You may try this:
<a
href="http://www.{{ $client->client_url }}"
class="btn btn-default"
target="_blank" <!-- If you want to open the external page in a new tab/window -->
>
Go back to {{ $client->client_name }} homepage
</a>
Also you can save the full URL
(including http://www.
) in database when saving it and just use href="{{ $client->client_url }}"
as suggested in other answer.