在laravel中检查请求URL

In dashboard.blade.php, I manage js library links.

So, as I don't want to include all libs in all pages, I do it like that:

@if (Request::is("mail/create"))
        {!! Html::script('js/plugins/ui/nicescroll.min.js') !!}
        {!! Html::script('js/sidebar_detached_sticky_custom.js') !!}
@endif

for each page or group of pages.

Thing is when I edit an item, I my URL have this format:

http://laravel.dev:8000/mail/1/edit

And as 1 is the shop Id and vary, my method doesn't work anymore....

Any way to fix my issue or to do it better???

Tx!

查看全部
donglu1973
donglu1973
2016/01/09 17:33
  • laravel
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复