How to get the last part of the current URL without the /
sign, dynamically?
For example:
In www.news.com/foo/bar
get bar
.
In www.news.com/foo/bar/fun
get fun
.
Where to put the function or how to implement this in the current view?
Of course there is always the Laravel way:
request()->segment(count(request()->segments()))