PHPackages                             hi019/laravel-scout-typesense - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hi019/laravel-scout-typesense

Abandoned → [https://github.com/typesense/laravel-scout-typesense-engine](/?search=https%3A%2F%2Fgithub.com%2Ftypesense%2Flaravel-scout-typesense-engine)Library[API Development](/categories/api)

hi019/laravel-scout-typesense
=============================

Typesense laravel/scout engine

024PHP

Since Jul 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/hi019/laravel-scout-typesense)[ Packagist](https://packagist.org/packages/hi019/laravel-scout-typesense)[ RSS](/packages/hi019-laravel-scout-typesense/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

*This is a fork of *

Use  instead!
==========================================================================

[](#use-httpsgithubcomtypesenselaravel-scout-typesense-engine-instead)

This repository is now deprecated. Most of its features are implemented in the official Scout Typesense engine linked above.

Laravel Scout Typesense Engine
==============================

[](#laravel-scout-typesense-engine)

Typesense engine for laravel/scout  .

 [![laravel-scout-typesense-engine
 socialcard](https://camo.githubusercontent.com/f819987379136beb157ad627579bc09b2dcbb5ffe4ceeffcbd3d9601f192507e/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f5479706573656e7365253230447269766572253230666f722532304c61726176656c2d53636f75742e706e673f7468656d653d6461726b267061636b6167654e616d653d6465766c6f6f70736e65742532466c61726176656c2d7479706573656e7365267061747465726e3d616e63686f727341776179267374796c653d7374796c655f31266465736372697074696f6e3d412b5479706573656e73652b2532387365617263682b656e67696e652532392b6472697665722b666f722b6c61726176656c2d73636f7574266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/f819987379136beb157ad627579bc09b2dcbb5ffe4ceeffcbd3d9601f192507e/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f5479706573656e7365253230447269766572253230666f722532304c61726176656c2d53636f75742e706e673f7468656d653d6461726b267061636b6167654e616d653d6465766c6f6f70736e65742532466c61726176656c2d7479706573656e7365267061747465726e3d616e63686f727341776179267374796c653d7374796c655f31266465736372697074696f6e3d412b5479706573656e73652b2532387365617263682b656e67696e652532392b6472697665722b666f722b6c61726176656c2d73636f7574266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

This package makes it easy to add full text search support to your models with Laravel 5.3 to 7.0. Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Author](#author)
- [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

Add the service provider:

```
// config/app.php
'providers' => [
    // ...
    hi019\LaravelTypesense\TypesenseServiceProvider::class,
],
```

Ensure you have Laravel Scout as a provider too otherwise you will get an "unresolvable dependency" error

```
// config/app.php
'providers' => [
    // ...
    Laravel\Scout\ScoutServiceProvider::class,
],
```

Add `SCOUT_DRIVER=typesense` to your `.env` file

Then you should publish `scout.php` configuration file to your config directory

```
php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
```

In your `config/scout.php` add:

```
'typesense' => [
    'api_key'         => 'abcd',
    'nodes'           => [
      [
        'host'     => 'localhost',
        'port'     => '8108',
        'path'     => '',
        'protocol' => 'http',
      ],
    ],
    'nearest_node'    => [
        'host'     => 'localhost',
        'port'     => '8108',
        'path'     => '',
        'protocol' => 'http',
    ],
    'connection_timeout_seconds'   => 2,
    'healthcheck_interval_seconds' => 30,
    'num_retries'                  => 3,
    'retry_interval_seconds'       => 1,
  ],
```

Usage
-----

[](#usage)

After you have installed scout and the Typesense driver, you need to add the `Searchable` trait to your models that you want to make searchable. Additionaly, define the fields you want to make searchable by defining the `toSearchableArray` method on the model and implement `TypesenseModel`:

```
