@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $groupped = $this->groupRowsByModelType($rows); |
| 152 | 152 | $models = collect([]); |
| 153 | 153 | |
| 154 | - $groupped->each(function (Collection $ids, string $model) use ($models) { |
|
| 154 | + $groupped->each(function(Collection $ids, string $model) use ($models) { |
|
| 155 | 155 | $results = $this->resourcesResolver->resolve($model, $ids->toArray()); |
| 156 | 156 | |
| 157 | 157 | if (!count($results['resources'])) { |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | $query = DB::table($this->modelsResolver->morphName().'s'); |
| 177 | 177 | $fieldValueModel = $this->modelsResolver->fieldValue(); |
| 178 | 178 | |
| 179 | - $filter->each(function ($value, int $fieldId) use ($query, $fieldValueModel) { |
|
| 180 | - $query->orWhere(function ($q) use ($fieldId, $value, $fieldValueModel) { |
|
| 179 | + $filter->each(function($value, int $fieldId) use ($query, $fieldValueModel) { |
|
| 180 | + $query->orWhere(function($q) use ($fieldId, $value, $fieldValueModel) { |
|
| 181 | 181 | $q->where('field_id', $fieldId) |
| 182 | 182 | ->whereIn('field_value_id', $this->resolveValuesId($value, $fieldValueModel)); |
| 183 | 183 | }); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | protected function mapIdsFromCollection(Collection $fieldValues, $fieldValueModel) |
| 252 | 252 | { |
| 253 | - $values = $fieldValues->map(function ($value) use ($fieldValueModel) { |
|
| 253 | + $values = $fieldValues->map(function($value) use ($fieldValueModel) { |
|
| 254 | 254 | if ($value instanceof $fieldValueModel) { |
| 255 | 255 | return $value->id; |
| 256 | 256 | } elseif (is_numeric($value)) { |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('products', function (Blueprint $table) { |
|
| 16 | + Schema::create('products', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name'); |
| 19 | 19 | $table->timestamps(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('fields', function (Blueprint $table) { |
|
| 16 | + Schema::create('fields', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name'); |
| 19 | 19 | $table->timestamps(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('field_values', function (Blueprint $table) { |
|
| 16 | + Schema::create('field_values', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->unsignedInteger('field_id')->index(); |
| 19 | 19 | $table->string('value'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('fieldables', function (Blueprint $table) { |
|
| 16 | + Schema::create('fieldables', function(Blueprint $table) { |
|
| 17 | 17 | $table->unsignedInteger('field_id')->index(); |
| 18 | 18 | $table->unsignedInteger('field_value_id')->index(); |
| 19 | 19 | $table->string('fieldable_type')->index(); |