PHPackages                             devloopsnet/laravel-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. [Search &amp; Filtering](/categories/search)
4. /
5. devloopsnet/laravel-typesense

Abandoned → [typesense/laravel-scout-typesense-driver](/?search=typesense%2Flaravel-scout-typesense-driver)ArchivedLibrary[Search &amp; Filtering](/categories/search)

devloopsnet/laravel-typesense
=============================

Typesense laravel/scout engine

v4.1.4(4y ago)466.5k14[1 issues](https://github.com/devloopsnet/laravel-scout-typesense-engine/issues)[1 PRs](https://github.com/devloopsnet/laravel-scout-typesense-engine/pulls)MITPHPPHP ^8.0

Since Apr 5Pushed 4y ago1 watchersCompare

[ Source](https://github.com/devloopsnet/laravel-scout-typesense-engine)[ Packagist](https://packagist.org/packages/devloopsnet/laravel-typesense)[ Docs](https://www.devloops.net)[ RSS](/packages/devloopsnet-laravel-typesense/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (10)Versions (18)Used By (0)

### ⚠️ This project has moved to the official Typesense Github org: . It was adopted as the official Typesense PHP client on Dec 2021 and ongoing development will take place there.

[](#️-this-project-has-moved-to-the-official-typesense-github-org-httpsgithubcomtypesenselaravel-scout-typesense-driverit-was-adopted-as-the-official-typesense-php-client-on-dec-2021-and-ongoing-development-will-take-place-there)

#### Please upgrade to the `typesense/laravel-scout-typesense-driver` composer package to receive new updates.

[](#please-upgrade-to-the-typesenselaravel-scout-typesense-driver-composer-package-to-receive-new-updates)

#### The rest of this Readme file is kept as is for posterity.

[](#the-rest-of-this-readme-file-is-kept-as-is-for-posterity)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ed076100b3971964c533cc0bc6e79ab7e591d5c0ad837d7cd7d4c59b34a52bf7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766c6f6f70736e65742f6c61726176656c2d7479706573656e73652e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/devloopsnet/laravel-typesense) [![Postcardware](https://camo.githubusercontent.com/97c40bd733ff9974edecedb00f50f1815339c1fbdaedfdc8930069791979c9ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f737463617264776172652d2546302539462539322538432d3139373539333f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/97c40bd733ff9974edecedb00f50f1815339c1fbdaedfdc8930069791979c9ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f737463617264776172652d2546302539462539322538432d3139373539333f7374796c653d666f722d7468652d6261646765)

[![Codacy Badge](https://camo.githubusercontent.com/90cc02ed2476b9636289aacf999c8bba85201c25e9f81cb7c81302d2604f9b7b/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3938633635333163613266313431636339633964653033376131356239633463)](https://app.codacy.com/gh/devloopsnet/laravel-scout-typesense-engine?utm_source=github.com&utm_medium=referral&utm_content=devloopsnet/laravel-scout-typesense-engine&utm_campaign=Badge_Grade_Settings) [![PHP from Packagist](https://camo.githubusercontent.com/6a161f91fd992e87c02f9f791c899e90902741cd2af52ee72efe5166d0f3a646/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6465766c6f6f70736e65742f6c61726176656c2d7479706573656e73653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devloopsnet/laravel-typesense) [![Total Downloads](https://camo.githubusercontent.com/48e26fcbdb11f47c421cd66635dde8a2a057d4d97b699557e5d5eba6be19c35f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465766c6f6f70736e65742f6c61726176656c2d7479706573656e73652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devloopsnet/laravel-typesense) [![StyleCI](https://camo.githubusercontent.com/49291d39432f7d77280530302b16e0ec7a88ae4c42a5a61f039e1a0e3056c2c4/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3235333332393235372f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/253329257?branch=master)

\# 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 7.\* to 8.\*. Contents
--------

[](#contents)

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

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

[](#installation)

You can install the package via composer:

```
composer require devloopsnet/laravel-typesense
```

Add the service provider:

```
// config/app.php
'providers' => [
    // ...
    Devloops\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 `TypesenseSearch`:

```
