New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

carlosocarvalho/laravel-auditing-es

A elasticsearch driver for the owen-it/laravel-auditing package. Allows storage of the audits in elasticsearch.
1,142

Larablocks Analysis

carlosocarvalho/laravel-auditing-es works with any PHP project: the latest release (v1.0.2, Jun 5, 2018) doesn't depend on Laravel.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • No release in the last 12 months (last: Jun 5, 2018)
  • 0 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jun 5, 2018.
  • No releases in the last 12 months.
  • First released: Jun 5, 2018.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require carlosocarvalho/laravel-auditing-es
Latest Version:v1.0.2
PHP:>=7.0
License:MIT
Last Updated:Jun 5, 2018
Links: GitHub  ·  Packagist
Maintainer: carlosocarvalho

Auditing Elasticsearch Driver

This driver provides the ability to save your model audits in elasticsearch.

Contents

Installation

This driver requires that you are using owen-it/laravel-auditing: ^7.0. Provided this is fulfilled, you can install the driver like so:

composer require carlosocarvalho/laravel-auditing-elasticsearch

Setup

You need to add the following config entries in config/audit.php if you need to change the default behaviour of the driver. The queue key of the config file should look like so:

    ...
    'queue' => env('AUDIT_QUEUE', true),
    ...

OR

    ...
    'queue' => env('AUDIT_QUEUE', [
        'queue' => 'default',
        'connection' => 'redis'
    ]),
    ...

The driver key of the config file should look like so:

    ...
    'driver' => CarlosOCarvalho\Auditing\Drivers\ElasticSearch::class,
    ...

The drivers key of the config file should look like so:

    ...
    'drivers' => [
        'database' => [
            'table'      => 'audits',
            'connection' => null,
        ],
        'es' => [
            'client' => [
                'hosts' => [
                    env('AUDIT_HOST', 'localhost:9200')
                ]
            ],
            'index' => env('AUDIT_INDEX', 'laravel_auditing'),
            'type' => env('AUDIT_TYPE', 'audits')
        ],
    ],
    ...

Console commands

Available artisan commands are listed below:

Command | Arguments | Description --- | --- auditing:es-index | Index all of the model's records into the search index. auditing:es-delete | Delete all of the model's records from the index.

For detailed description and all available options run php artisan help [command] in the command line.

Usage

You can use the ElasticSearch driver in any Auditable model like so in order to store audit records in elasticsearch:

<?php
namespace App\Models;

use Iconscout\Auditing\Drivers\ElasticSearch;
use Illuminate\Database\Eloquent\Model;
use OwenIt\Auditing\Auditable;
use OwenIt\Auditing\Contracts\Auditable as AuditableContract;

class SomeModel extends Model implements AuditableContract
{
    use Auditable;

    /**
     * ElasticSearch Audit Driver
     *
     * @var Iconscout\Auditing\Drivers\ElasticSearch
     */
    protected $auditDriver = ElasticSearch::class;

    // ...
}

You can use the ElasticSearchAuditable trait in any Auditable model like so in order to retrieving Retrieving audit records records from elasticsearch:

<?php
namespace App\Models;

use Iconscout\Auditing\Drivers\ElasticSearch;
use Iconscout\Auditing\Traits\ElasticSearchAuditable;
use Illuminate\Database\Eloquent\Model;
use OwenIt\Auditing\Auditable;
use OwenIt\Auditing\Contracts\Auditable as AuditableContract;

class SomeModel extends Model implements AuditableContract
{
    use Auditable, ElasticSearchAuditable;

    /**
     * ElasticSearch Audit Driver
     *
     * @var Iconscout\Auditing\Drivers\ElasticSearch
     */
    protected $auditDriver = ElasticSearch::class;

    // ...
}
// Get first available Icon
$icon = Icon::first();

// Get all associated Audits
$all = $icon->esAudits;

// Get all associated Audits via parameters ($page & $perPage)
$all = $icon->esAudits($page = 1, $perPage = 10);

Donations

Help keeping the project development going, by contributing or donating a little. Thanks in advance.

Donate directly via Paypal

Donate

More information on using customer drivers with owen-it/laravel-auditing can be found on their homepage

Alternatives to carlosocarvalho/laravel-auditing-es

owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

46,608,560 3,475
rap2hpoutre/laravel-log-viewer

A Laravel log reader

16,981,969 3,193
venturecraft/revisionable

Keep a revision history for your models without thinking, created as a package f...

7,917,316 2,609
rajmundtoth0/laravel-auditing-elasticsearch-driver

An Elasticsearch driver for the owen-it/laravel-auditing package.

210,446 7
altek/accountant

The auditing & accountability package for Laravel's Eloquent ORM.

1,148,755 90

Version History

Version Released PHP License
v1.0.2 >=7.0 MIT
v1.0.1 >=7.0 MIT
v1.0.0 >=7.0 MIT