PHPackages                             majidalaeinia/refresh-elastic - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. majidalaeinia/refresh-elastic

ActiveLibrary[Testing &amp; Quality](/categories/testing)

majidalaeinia/refresh-elastic
=============================

Refresh Elasticsearch indices for your tests (delete the indices and index them again based on their mappings if available).

1.0.0(4y ago)61801MITPHPPHP ~8

Since Feb 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/majidalaeinia/refresh-elastic)[ Packagist](https://packagist.org/packages/majidalaeinia/refresh-elastic)[ Docs](https://github.com/majidalaeinia/refresh-elastic)[ RSS](/packages/majidalaeinia-refresh-elastic/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Refresh Elastic
===============

[](#refresh-elastic)

You can use this package to refresh elastic indices (delete the index and make the index again with its corresponding mapping).
Inspired by [Laravel RefreshDatabase](https://github.com/laravel/framework/blob/b9203fca96960ef9cd8860cb4ec99d1279353a8d/src/Illuminate/Foundation/Testing/RefreshDatabase.php).

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

[](#installation)

Via Composer

```
$ composer require majidalaeinia/refresh-elastic --dev
```

Usage
-----

[](#usage)

First you need to publish the config file.

```
php artisan vendor:publish --tag=majidalaeinia-refresh-elastic.config
```

Fill the config file with appropriate values.

Then, use the `RefreshElastic` trait on your test.

```
