使用is()方法:
is()
@if (request()->is($url)) @include('partials._search') @endif
或者如果您知道路线名称:
@if (request()->route()->getName() === $routeName) @include('partials._search') @endif