You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ For detailed description and all available options run `php artisan help [comman
86
86
87
87
## Usage
88
88
89
-
You can use the driver in any Auditable model like so:
89
+
You can use the ElasticSearch driver in any Auditable model like so in order to store audit records in elasticsearch:
90
90
91
91
```
92
92
<?php
@@ -112,6 +112,44 @@ class SomeModel extends Model implements AuditableContract
112
112
}
113
113
```
114
114
115
+
You can use the ElasticSearchAuditable trait in any Auditable model like so in order to retrieving Retrieving audit records records from elasticsearch:
116
+
117
+
```
118
+
<?php
119
+
namespace App\Models;
120
+
121
+
use Iconscout\Auditing\Drivers\ElasticSearch;
122
+
use Iconscout\Auditing\Traits\ElasticSearchAuditable;
123
+
use Illuminate\Database\Eloquent\Model;
124
+
use OwenIt\Auditing\Auditable;
125
+
use OwenIt\Auditing\Contracts\Auditable as AuditableContract;
126
+
127
+
class SomeModel extends Model implements AuditableContract
128
+
{
129
+
use Auditable, ElasticSearchAuditable;
130
+
131
+
/**
132
+
* ElasticSearch Audit Driver
133
+
*
134
+
* @var Iconscout\Auditing\Drivers\ElasticSearch
135
+
*/
136
+
protected $auditDriver = ElasticSearch::class;
137
+
138
+
// ...
139
+
}
140
+
```
141
+
142
+
```
143
+
// Get first available Icon
144
+
$icon = Icon::first();
145
+
146
+
// Get all associated Audits
147
+
$all = $icon->esAudits;
148
+
149
+
// Get all associated Audits via parameters ($page & $perPage)
150
+
$all = $icon->esAudits($page = 1, $perPage = 10);
151
+
```
152
+
115
153
## Donate
116
154
117
155
:coffee: If you like my package, it'd be nice of you [to buy me a cup of coffee](https://www.paypal.me/rankarpan).
0 commit comments