I mistakenly thought that I could do this through the route() helper function but that gives me the fully qualified url. I only want to get the path (i.e. http://domain.com/url/path)
Maybe I should've been a little more clear. Sorry. The purpose of me getting the path only of a named route is so I can reference only the name of the route whenever I would like to do redirections throughout the application. For instance
public function fooMethod ()
{
...some validation code...
...once validation has passed...
...redirect here...
return redirect({namedRoute});
}
The named route of course is described in the route file:
Where namedRoute would give me the path assigned to it. I'm wanting to do this just in case I need to change the name of the url paths at any time. I therefore wouldn't have to go change the hardcoded path in multiple files.
Sorry. I am still confused as to why you want /url/path. As per your post:
The purpose of me getting the path only of a named route is so I can reference only the name of the route whenever I would like to do redirections throughout the application.
That is precisely what the route() helper function is for. To generate a url based on a named route. You are still free to change the url in your routes.php. As long as you don't change the name of the route, this will continue to work.
I also have the same goal as this. My intention is that since I have so many links inside my view, having the host/domain part seems to be so redundant and a waste of bandwidth.