@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function update($models) |
| 32 | 32 | { |
| 33 | 33 | $this->initIndex($models->first()); |
| 34 | - $models->each(function ($model) { |
|
| 34 | + $models->each(function($model) { |
|
| 35 | 35 | $searchableFields = $this->getSearchableFields($model); |
| 36 | 36 | |
| 37 | 37 | $this->tnt->selectIndex("{$model->searchableAs()}.index"); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function delete($models) |
| 55 | 55 | { |
| 56 | 56 | $this->initIndex($models->first()); |
| 57 | - $models->each(function ($model) { |
|
| 57 | + $models->each(function($model) { |
|
| 58 | 58 | $this->tnt->selectIndex("{$model->searchableAs()}.index"); |
| 59 | 59 | $index = $this->tnt->getIndex(); |
| 60 | 60 | $index->delete($model->id); |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | protected function filters(Builder $builder) |
| 115 | 115 | { |
| 116 | - return collect($builder->wheres)->map(function ($value, $key) { |
|
| 117 | - return $key . '=' . $value; |
|
| 116 | + return collect($builder->wheres)->map(function($value, $key) { |
|
| 117 | + return $key.'='.$value; |
|
| 118 | 118 | })->values()->all(); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $model->getKeyName(), $keys |
| 137 | 137 | )->get()->keyBy($model->getKeyName()); |
| 138 | 138 | |
| 139 | - return collect($results['ids'])->map(function ($hit) use ($models) { |
|
| 139 | + return collect($results['ids'])->map(function($hit) use ($models) { |
|
| 140 | 140 | return $models[$hit]; |
| 141 | 141 | }); |
| 142 | 142 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | { |
| 160 | 160 | $indexName = $model->searchableAs(); |
| 161 | 161 | |
| 162 | - if (!file_exists($this->tnt->config['storage'] . "/{$indexName}.index")) { |
|
| 162 | + if (!file_exists($this->tnt->config['storage']."/{$indexName}.index")) { |
|
| 163 | 163 | $indexer = $this->tnt->createIndex("$indexName.index"); |
| 164 | 164 | $indexer->disableOutput = true; |
| 165 | 165 | $fields = implode(', ', $model->searchable); |