Completed
Push — master ( 7379a4...c790f5 )
by Timur
02:07
created
src/FieldsManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
database/migrations/2017_05_13_000000_create_products_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
database/migrations/2017_05_13_000000_create_fields_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
database/migrations/2017_05_13_000000_create_field_values_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
database/migrations/2017_05_13_000000_create_fieldables_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.