blemli / websearch-for-filament
Search the web from any Filament field
Requires
- php: ^8.2
- filament/filament: ^4.0|^5.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- jeffgreco13/filament-breezy: ^3.0
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.7|^4.0
- pestphp/pest-plugin-arch: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
- pestphp/pest-plugin-livewire: ^3.0|^4.0
- rector/rector: ^2.0
Suggests
- jeffgreco13/filament-breezy: Lets users pick their search engine on the My Profile page
- spatie/laravel-activitylog: Logs every opened search when tracking is on
Provides
None
Conflicts
None
Replaces
None
README
Search the web from any Filament field.
A hint action that opens a search for the field's value on Google, DuckDuckGo, Bing, Brave, Swisscows, Ecosia, Startpage, Qwant, Yandex or Baidu, with harmonised filters (images, videos, news, shopping, license, transparency, size, layout, timespan, country). Users can pick their own engine. No migration needed.
Installation
composer require blemli/websearch-for-filament php artisan websearch-for-filament:install -n
Register the plugin in your panel provider: ->plugin(WebSearchPlugin::make()->userChoice())
Usage
TextInput::make('name')->websearch(), // "Search on Google" for the field's value FileUpload::make('image')->imagesearch(['vendor', 'name']), // image search for two fields joined FileUpload::make('image')->imagesearch('name', fn (WebSearchAction $a) => $a->transparent()->license(License::CreativeCommons)), WebSearchAction::make()->query('name')->engine(DuckDuckGo::class)->news()->within(Timespan::Week), // any action slot Google::images('Fujifilm GFX')->transparent()->layout(Layout::Tall)->url(); // just the URL, no Filament needed
Results open in a new tab by default; ->openInSameTab(), ->openInPopup() and ->openInSlideOver() (Swisscows, Bing, Baidu) are available on the action and in the user's profile (restrict them with ->exceptOpenModes([OpenIn::Popup])) when Filament Breezy is installed. ->trackSearches() on the plugin fires a SearchOpened event and logs to spatie/laravel-activitylog when present. Ships in English and German.
License
MIT © blemli
