PHPackages                             carropublic/herosearch - 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. carropublic/herosearch

ActiveLibrary[Search &amp; Filtering](/categories/search)

carropublic/herosearch
======================

Laravel scout with elastic search driver

3.0.1(2y ago)082.2k↓72.5%2MITPHPCI failing

Since May 5Pushed 2y ago6 watchersCompare

[ Source](https://github.com/carro-public/hero-search)[ Packagist](https://packagist.org/packages/carropublic/herosearch)[ Docs](https://github.com/carropublic/herosearch)[ RSS](/packages/carropublic-herosearch/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (0)

HeroSearch
==========

[](#herosearch)

Laravel Scout elasticsearch driver base on our own needs.

What's hero-search?
-------------------

[](#whats-hero-search)

Before Carro, it was car hero. Base on that, we named our elastic-scout package as hero search. Hero search is a scout package. We created this for our own needs. Currently, this was mostly inspred via [this course](https://codecourse.com/courses/create-a-laravel-scout-elasticsearch-driver). We will keep add the features base on our needs.

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

[](#installation)

Make sure you have installed [elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-install.html)

```
$ composer require carropublic/herosearch

```

You should publish Scout and ElasticSearch configuration using:

```
$ php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
$ php artisan vendor:publish --provider="CarroPublic\HeroSearch\HeroSearchServiceProvider"

```

Package Configuration
---------------------

[](#package-configuration)

In your `.env` file, add host and port of your running elasticsearch.

```
ELASTICSEARCH_HOST=your_elasticsearch_host
ELASTICSEARCH_PORT=your_elasticsearch_port

# This prefix will be used to append before the index name
# To separate environement when sharing ES instance
ELASTICSEARCH_INDEX_PREFIX=prefix

```

Update scout driver to `elasticsearch` as well.

```
SCOUT_DRIVER=elasticsearch

```

Usage example
-------------

[](#usage-example)

Use scout `Searchable` trait in your model

```
