Getting started
Library
Components
Integrations
Search
You can use the search bar at the top of the Media Library to quickly find files and folders by name.
How search works
When you type in the search bar, the Media Library searches the name of each item. For files (stored via the MediaLibraryItem driver), the name comes from the underlying Spatie Media Library media record – matching against the stored file name. For folders, the search matches against the folder name directly.
Search uses a LIKE '%…%' query, so partial matches work out of the box.
Searching inside subfolders
By default, when you are browsing inside a subfolder and type a search query, the Media Library expands the search to the entire library – ignoring the current folder scope. A hint appears below the search bar indicating the folder you were in, with a link to restrict the search back to that folder only.
This behaviour is enabled by default. To disable it and keep search scoped to the current folder at all times, call searchNestedFolders(false) on the plugin:
use RalphJSmit\Filament\MediaLibrary\FilamentMediaLibrary;
$panel->plugin(
FilamentMediaLibrary::make()
->searchNestedFolders(false),
);
Pass true (the default) to restore the root-search behaviour.