How to define route group name in laravel

后端 未结 4 625
予麋鹿
予麋鹿 2020-12-15 17:05

Is there any way to define the name of route group in laravel?

What I\'m trying to accomplish by this is to know that the current request belongs to which group so I

4条回答
  •  天命终不由人
    2020-12-15 17:16

    It should work-

    inside blade-

    {{ $yourRouteName = \Request::route()->getName() }}
    
    // Find the first occurrence of account in URL-
    
    @if(strpos($routeName, 'account.') === 0)
      console the message or your code
    @endif
    

提交回复
热议问题