I have a url : http://localhost:8888/projects/oop/2
http://localhost:8888/projects/oop/2
I want to access the first segment --> projects
projects
I\'ve tried
Here is how one can do it via the global request helper function.
request
{{ request()->segment(1) }}
Note: request() returns the object of the Request class.
request()
Request