Show a search input bar depending on which path the user currently is viewing
You could use PHPs in_array() function to test the current route against your required routes:

@php ( $searchRoutes = ['foo', 'bar'] )
@if( in_array(request()-&gt;route()-&gt;getName(), $searchRoutes))
   @include('partials._search')
@endif


You could define the allowed routes array in your controller and pass this into the blade template.