If for only a specific route you can change the url in the route definition (web.php), it's the usage case of route names.
May 5, 2021
7
Level 1
How to get route prefix of a specific route by name?
I know you can get route prefix of current route like this
request()->route()->getPrefix()
but what if I want to get the prefix of a route with name tags.show, some thing like(not worked obviously)
route('tags.show')->getPrefix()
The part http://192.168.100.150/tags is currently hardcoded, I want it dynamic in case of change route/domain in the future

Thanks!
Level 75
@sakurikii Just use named route, I don't know why is it a problem for you.
<span class="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 text-sm">
{{ route('tags.show', ['tag' => null]) }}
</span>
1 like
Please or to participate in this conversation.