| @@ 20-28 (lines=9) @@ | ||
| 17 | * Runs when a model is created |
|
| 18 | * @param $model |
|
| 19 | */ |
|
| 20 | public function created($model) |
|
| 21 | { |
|
| 22 | $params = [ |
|
| 23 | 'type' => $model->getIndexType(), |
|
| 24 | 'id' => $model->getIndexId(), |
|
| 25 | 'body' => $model->getSearchableIndex(), |
|
| 26 | ]; |
|
| 27 | dispatch(new IndexModel($model, $params,'index')); |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Runs when a model is updated |
|
| @@ 34-44 (lines=11) @@ | ||
| 31 | * Runs when a model is updated |
|
| 32 | * @param $model |
|
| 33 | */ |
|
| 34 | public function updated($model) |
|
| 35 | { |
|
| 36 | $params = [ |
|
| 37 | 'type' => $model->getIndexType(), |
|
| 38 | 'id' => $model->getIndexId(), |
|
| 39 | 'body' => [ |
|
| 40 | 'doc' => $model->getSearchableIndex() |
|
| 41 | ], |
|
| 42 | ]; |
|
| 43 | dispatch(new IndexModel($model, $params,'update')); |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Runs when a model is updated |
|
| @@ 50-58 (lines=9) @@ | ||
| 47 | * Runs when a model is updated |
|
| 48 | * @param $model |
|
| 49 | */ |
|
| 50 | public function restored($model) |
|
| 51 | { |
|
| 52 | $params = [ |
|
| 53 | 'type' => $model->getIndexType(), |
|
| 54 | 'id' => $model->getIndexId(), |
|
| 55 | 'body' => $model->getSearchableIndex(), |
|
| 56 | ]; |
|
| 57 | dispatch(new IndexModel($model, $params,'create')); |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Runs when a model is deleted |
|