Used to create MoonShine layouts.
The Search
component adds a search form to layout.
Search::make()
Search::make()
<x-moonshine::layout.searchplaceholder="Search..."/>
<x-moonshine::layout.searchplaceholder="Search..."/>
Modifiers are also available for both the input and the entire form.
Search::make()->modifyInput(fn(Text $input) => $input)->modifyForm(fn(FormBuilder $form) => $form)
Search::make()->modifyInput(fn(Text $input) => $input)->modifyForm(fn(FormBuilder $form) => $form)
By default, in the standard layout, the Search
component is located in the Header
component, but it also fits well into the Sidebar
.
To place the search form in the sidebar, you can use the sidebarSlot() method.
For more information about how the search works, see ModelResource > Search.