This script command provides a quick way of searching the Laravel documentation.
It accepts a query and will open the first result in your default browser.
-
Begin by creating a
~/.config/raycast/scriptsfolder if you don't already have one. -
Add the
laravel.jsandpackage.jsonfile to this folder.
If you already have a
package.jsonin this folder, runnpm install open algoliasearch -Dinstead.
- Add the
~/.config/raycast/scriptsfolder to Raycast
Open Raycast and search for
Extensions. Hit Cmd + N and choose "Add Script Directory". Navigate to and choose the~/.config/raycast/scriptsfolder.
-
Open Raycast and type
laravel. It should appear as a Script Command. -
Hit Enter and you'll be prompted to enter your search query. Type your search and hit enter. The Raycast output window will tell you how many results were found and it'll open the most relevant in your default browser.
For @weavdale and anyone else that might stumble across this.
To make sure you always have the latest search results from the Laravel docs, I've used the Algolia keys from the documentation site. This way you'll have access to everything from 4.2 to current the current master branch (as long as you've set that version inside the
facetFilterskey of thelaravel.jsfile and provided Laravel don't ever change the keys).Make a simple change to
laravel.json line 20and on line 24