How to access URL segment(s) in blade in Laravel 5?

前端 未结 6 717
滥情空心
滥情空心 2021-02-03 17:43

I have a url : http://localhost:8888/projects/oop/2

I want to access the first segment --> projects

I\'ve tried

6条回答
  •  执念已碎
    2021-02-03 18:15

    The double curly brackets are processed via Blade -- not just plain PHP. This syntax basically echos the calculated value.

    {{ Request::segment(1) }} 
    

提交回复
热议问题