Get Laravel 5 controller name in view

后端 未结 4 1645
渐次进展
渐次进展 2020-12-03 14:02

Our old website CSS was set up so that the body tag had an id of the controller name and a class of the action name, using Zend Framework 1. Now we\'re switchi

4条回答
  •  [愿得一人]
    2020-12-03 14:19

    I use a simple solution. You can test and use it in everywhere, also in your views:

    {{ dd(request()->route()->getAction()) }}
    

提交回复
热议问题