Looking to hire Laravel developers? Try LaraJobs

laravel-scout-upstash-search maintained by ossycodes

Description
A Laravel Scout engine for Upstash Search
Last update
2026/08/07 21:20 (dev-master)
License
Links
Downloads
0

Comments
comments powered by Disqus

Laravel Scout Upstash Search

A Laravel Scout driver for Upstash Search.

Installation

composer require laravel-upstash-search/laravel-scout-upstash-search

Configuration

Add your Upstash Search credentials to your .env:

UPSTASH_SEARCH_URL=https://your-search-url
UPSTASH_SEARCH_TOKEN=your-upstash-token

Publish the config file:

php artisan vendor:publish --provider="LaravelUpstashSearch\Scout\UpstashSearchServiceProvider" --tag="config"

Setup

Configure your model to use the Upstash driver:

use Laravel\Scout\Searchable;

class Post extends Model
{
    use Searchable;

    protected $searchableAs = 'posts';

    public function toSearchableArray()
    {
        return [
            'title' => $this->title,
            'body' => $this->body,
        ];
    }
}

Update config/scout.php:

'driver' => env('SCOUT_DRIVER', 'upstash'),

Usage

// Search
$results = Post::search('laravel')->get();

// Paginate
$results = Post::search('laravel')->paginate(15);

// Import all records
php artisan scout:upstash-import "App\Models\Post"

Documentation

For more information on Upstash Search, visit the Upstash Search Documentation.

License

MIT