how to info list text url to external site?

Hi, i'm having problem with this. My code is like this
TextEntry::make('address')

->url(function (string $state): string {
return urlencode('https://www.google.com/maps/dir/?api=1&query="' . $state . '"');
})
->openUrlInNewTab()
->copyable()
->columnSpanFull(),
TextEntry::make('address')

->url(function (string $state): string {
return urlencode('https://www.google.com/maps/dir/?api=1&query="' . $state . '"');
})
->openUrlInNewTab()
->copyable()
->columnSpanFull(),
However the url is 'https://www.my-site-domain.com/https://www.google.com/maps/dir/?api=1&query= ...' How do i get it to not prepend my site domain?
1 Reply
pocket.racer
pocket.racerOP15mo ago
ok i figured out It's okay if i do this return 'https:://google.com?query=' . urlencode($state) But if i were to wrap the whole string in urlencode, it will prepend the site domain return urlencode('https://www.yahoo.com') // this will prepend the site domain
Want results from more Discord servers?
Add your server