laravel - How not to show on a page of chunk of layout? -


i have common layout pages in it, include "form search" (search in header). on page "global search" not display search.

how nicely? check title or route, thing came mind

layout -> include (search.form) -> page  

i think best option here utilise route::is($name) in view. allows check if route being accessed, require use of named route, however.

routes.php

route::get('/search', ['uses' => 'searchcontroller@search', 'as' => 'global-search']); 

view

@if ( ! route::is('global-search'))      @include('search.form')  @endif 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -