Skip to content
SearchJet
Laravel + REST API

Powerful Search for Laravel

Integrate SearchJet with your Laravel application in minutes using Laravel's built-in HTTP client. No package to install. Works with Eloquent observers and queues, built for developers who demand elegance and performance.

Laravel 8, 9, 10, 11
No Package Required
Laravel HTTP Client

Get Started in Seconds

Familiar Laravel syntax you already know and love

Terminal / Code Editor
# .env
SEARCHJET_SEARCH_KEY=your_search_key
SEARCHJET_PRIVATE_KEY=your_private_key   # server-side only, never in browser code

// config/services.php
'searchjet' => [
    'key' => env('SEARCHJET_SEARCH_KEY'),
    'private_key' => env('SEARCHJET_PRIVATE_KEY'),
],

// Search with Laravel's built-in HTTP client (no package needed).
// The API key decides which index is searched.
use Illuminate\Support\Facades\Http;

$hits = Http::withToken(config('services.searchjet.key'))
    ->get('https://app.searchjetengine.com/api/v1/search', [
        'q' => 'Laravel',
        'limit' => 15,
        'offset' => 0,
    ])
    ->json('results'); // array of hits: id, title, content, url, excerpt, ...

// app/Observers/PostObserver.php (your own code, not a package)
// Register it in AppServiceProvider::boot(): Post::observe(PostObserver::class);
class PostObserver
{
    public function saved(Post $post): void
    {
        // For busy apps, move this call into a queued job.
        Http::withToken(config('services.searchjet.private_key'))
            ->post('https://app.searchjetengine.com/api/v1/index/bulk', [
                'documents' => [[
                    'id' => (string) $post->id,
                    'title' => $post->title,
                    'content' => strip_tags($post->content),
                    'url' => route('posts.show', $post),
                    'date' => $post->published_at?->toIso8601String(),
                ]],
                'mode' => 'upsert',
            ]);
    }
}

Built for Laravel Developers

Built on the Laravel features you already use

Eloquent Integration

Map any Eloquent model to a search document in a few lines of your own code. No package or trait required.

Artisan Commands

Write a short Artisan command that chunks your models and sends them to the bulk indexing endpoint for the initial import.

Queue Support

Send index updates from a queued job so saving a model never waits on the search API.

Standard Config

Keys live in .env and config/services.php, following normal Laravel conventions.

Real-Time Indexing

Keep the index in sync with a model observer that pushes changes whenever a model is saved.

Any HTTP Client

It is a plain REST API. Laravel's Http facade, Guzzle, or any other HTTP client works.

4 Steps to Powerful Search

From installation to production in under 10 minutes

1

Get API Keys

Copy your search key and private key from the SearchJet dashboard. No Composer package to install.

SEARCHJET_PRIVATE_KEY=your_private_key
2

Configure

Add both keys to .env and reference them in config/services.php

'searchjet' => ['key' => env('SEARCHJET_SEARCH_KEY')]
3

Sync Models

Add a model observer that POSTs saved models to /index/bulk with the private key

Post::observe(PostObserver::class);
4

Search

Call GET /search with Laravel's HTTP client and read the results array

Http::withToken($key)->get($url, ['q' => $q])

Perfect for Any Laravel Project

From small applications to enterprise platforms

🏢

Multi-Tenant SaaS

Index a tenant_id field, mark it filterable, and filter every search by tenant.

📰

Content Platforms

Search articles, pages, and media with full-text search and relevance scoring.

🛒

E-commerce

Power product search with filtering, faceting, and merchandising features.

📚

Knowledge Base

Build searchable documentation and help centers with instant results.

Why Laravel Developers Choose SearchJet

A plain REST API that fits naturally into Laravel's HTTP client, observers and queues.

No package to install: Laravel's built-in HTTP client is all you need
Search across multiple models by indexing a type field with each document
Filtering with filter expressions on attributes marked filterable
Pagination with limit and offset, easy to wrap in a LengthAwarePaginator
Model observers for automatic index updates
Private key stays server-side in .env; the search key is safe for browser calls
Easy to test with Laravel's Http::fake()
Comprehensive documentation and code examples
⚡

Ready to Power Up Your Laravel Search?

Add two keys to .env and experience enterprise-grade search with Laravel's elegance.

Need Help or Have Questions?

Check out our comprehensive documentation or reach out to our support team.