diff --git a/README.md b/README.md index 6502273..0e520ec 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Add the Livewire directive `@livewire('livewire-ui-spotlight')`: ``` -## Alpine +## Alpine (only when using Livewire v2) Spotlight requires [Alpine](https://github.com/alpinejs/alpine). You can use the official CDN to quickly include Alpine: @@ -59,10 +59,14 @@ To open the Spotlight input bar you can use one of the following shortcuts: You can customize the keybindings in the configuration file (see below). It's also possible to toggle Spotlight from any other Livewire component or via Javascript. -In any Livewire component you can use the `dispatchBrowserEvent` helper. +In any Livewire component you can use the `dispatchBrowserEvent` or `dispatch` helper. ```php +// Livewire v2 $this->dispatchBrowserEvent('toggle-spotlight'); + +// Livewire v3 +$this->dispatch('toggle-spotlight'); ``` You can also use the `$dispatch` helper from Alpine to trigger the same browser event from your markup. diff --git a/composer.json b/composer.json index 9e22b21..771fa0f 100644 --- a/composer.json +++ b/composer.json @@ -6,19 +6,19 @@ "laravel", "spotlight" ], - "homepage": "https://github.com/livewire-ui/spotlight", + "homepage": "https://github.com/wire-elements/spotlight", "license": "MIT", "authors": [ { "name": "Philo Hermans", - "email": "me@philohermans.com", + "email": "support@wire-elements.dev", "role": "Developer" } ], "require": { - "php": "^8.0", + "php": "^8.1", "illuminate/contracts": "^8.0|^9.0|^10.0", - "livewire/livewire": "^2.4", + "livewire/livewire": "^3.0", "spatie/laravel-package-tools": "^1.4.3" }, "require-dev": { diff --git a/resources/views/spotlight.blade.php b/resources/views/spotlight.blade.php index 206018a..b6fc8cd 100644 --- a/resources/views/spotlight.blade.php +++ b/resources/views/spotlight.blade.php @@ -7,7 +7,7 @@ @endisset