We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ -45,7 +45,7 @@ | ||
| 45 | 45 | $secondary_ids[$second_item] = $second_item; | 
| 46 | 46 | } | 
| 47 | 47 | } | 
| 48 | -        }else{ //create dependecies from relation if not from validate error | |
| 48 | +        } else{ //create dependecies from relation if not from validate error | |
| 49 | 49 |            foreach( $primary_array as $primary_item ){ | 
| 50 | 50 |              foreach($primary_item[$secondary_dependency['entity']] as $second_item ){ | 
| 51 | 51 | $secondary_ids[$second_item['id']] = $second_item['id']; | 
| @@ -2,34 +2,34 @@ discard block | ||
| 2 | 2 |  <div class="form-group col-md-12 checklist_dependency"  data-entity ="{{ $field['field_unique_name'] }}" @include('crud::inc.field_wrapper_attributes')> | 
| 3 | 3 |      <label>{!! $field['label'] !!}</label> | 
| 4 | 4 | <?php | 
| 5 | - $entity_model = $crud->getModel(); | |
| 5 | + $entity_model = $crud->getModel(); | |
| 6 | 6 | |
| 7 | - //short name for dependency fields | |
| 8 | - $primary_dependency = $field['subfields']['primary']; | |
| 9 | - $secondary_dependency = $field['subfields']['secondary']; | |
| 7 | + //short name for dependency fields | |
| 8 | + $primary_dependency = $field['subfields']['primary']; | |
| 9 | + $secondary_dependency = $field['subfields']['secondary']; | |
| 10 | 10 | |
| 11 | 11 | |
| 12 | - //all items with relation | |
| 13 | - $dependencies = $primary_dependency['model']::with($primary_dependency['entity_secondary'])->get(); | |
| 12 | + //all items with relation | |
| 13 | + $dependencies = $primary_dependency['model']::with($primary_dependency['entity_secondary'])->get(); | |
| 14 | 14 | |
| 15 | - $dependencyArray = []; | |
| 15 | + $dependencyArray = []; | |
| 16 | 16 | |
| 17 | - //convert dependency array to simple matrix ( prymary id as key and array with secondaries id ) | |
| 18 | -      foreach($dependencies as $primary){ | |
| 19 | - $dependencyArray[$primary->id] = []; | |
| 17 | + //convert dependency array to simple matrix ( prymary id as key and array with secondaries id ) | |
| 18 | +        foreach($dependencies as $primary){ | |
| 19 | + $dependencyArray[$primary->id] = []; | |
| 20 | 20 |          foreach($primary->{$primary_dependency['entity_secondary']} as $secondary){ | 
| 21 | 21 | $dependencyArray[$primary->id][] = $secondary->id; | 
| 22 | 22 | } | 
| 23 | - } | |
| 23 | + } | |
| 24 | 24 | |
| 25 | - //for update form, get initial state of the entity | |
| 26 | -      if( isset($id) && $id ){ | |
| 25 | + //for update form, get initial state of the entity | |
| 26 | +        if( isset($id) && $id ){ | |
| 27 | 27 | |
| 28 | 28 | //get entity with relations for primary dependency | 
| 29 | 29 | $entity_dependencies = $entity_model->with($primary_dependency['entity']) | 
| 30 | - ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) | |
| 31 | -          ->where('id', $id) | |
| 32 | - ->first(); | |
| 30 | + ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) | |
| 31 | +            ->where('id', $id) | |
| 32 | + ->first(); | |
| 33 | 33 | |
| 34 | 34 | $secondaries_from_primary = []; | 
| 35 | 35 | |
| @@ -40,22 +40,22 @@ discard block | ||
| 40 | 40 | |
| 41 | 41 | //create secondary dependency from primary relation, used to check what chekbox must be check from second checklist | 
| 42 | 42 |          if( old($primary_dependency['name']) ) { | 
| 43 | -          foreach( old($primary_dependency['name']) as $primary_item ){ | |
| 43 | +            foreach( old($primary_dependency['name']) as $primary_item ){ | |
| 44 | 44 |              foreach($dependencyArray[$primary_item] as $second_item ){ | 
| 45 | 45 | $secondary_ids[$second_item] = $second_item; | 
| 46 | 46 | } | 
| 47 | - } | |
| 47 | + } | |
| 48 | 48 |          }else{ //create dependecies from relation if not from validate error | 
| 49 | -          foreach( $primary_array as $primary_item ){ | |
| 49 | +            foreach( $primary_array as $primary_item ){ | |
| 50 | 50 |              foreach($primary_item[$secondary_dependency['entity']] as $second_item ){ | 
| 51 | 51 | $secondary_ids[$second_item['id']] = $second_item['id']; | 
| 52 | 52 | } | 
| 53 | - } | |
| 53 | + } | |
| 54 | + } | |
| 54 | 55 | } | 
| 55 | - } | |
| 56 | 56 | |
| 57 | - //json encode of dependency matrix | |
| 58 | - $dependencyJson = json_encode($dependencyArray); | |
| 57 | + //json encode of dependency matrix | |
| 58 | + $dependencyJson = json_encode($dependencyArray); | |
| 59 | 59 | ?> | 
| 60 | 60 | <script> | 
| 61 | 61 |          var  {{ $field['field_unique_name'] }} = {!! $dependencyJson !!}; | 
| @@ -1,10 +1,10 @@ | ||
| 1 | 1 |  {{-- checkbox with loose false/null/0 checking --}} | 
| 2 | 2 | <?php | 
| 3 | - $icon = "fa-check-square-o"; | |
| 4 | -	if (strip_tags($entry->{$column['name']}) == false) | |
| 5 | -	{ | |
| 6 | - $icon = "fa-square-o"; | |
| 7 | - } | |
| 3 | + $icon = "fa-check-square-o"; | |
| 4 | +    if (strip_tags($entry->{$column['name']}) == false) | |
| 5 | +    { | |
| 6 | + $icon = "fa-square-o"; | |
| 7 | + } | |
| 8 | 8 | ?> | 
| 9 | 9 | |
| 10 | 10 | <td> | 
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 |  {{-- custom return value via attribute --}} | 
| 2 | 2 | <td> | 
| 3 | 3 | <?php | 
| 4 | -	    echo $entry->{$column['function_name']}()->{$column['attribute']}; | |
| 4 | +        echo $entry->{$column['function_name']}()->{$column['attribute']}; | |
| 5 | 5 | ?> | 
| 6 | 6 | </td> | 
| 7 | 7 | \ No newline at end of file | 
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 |  {{-- custom return value --}} | 
| 2 | 2 | <td> | 
| 3 | 3 | <?php | 
| 4 | -	    echo $entry->{$column['function_name']}(); | |
| 4 | +        echo $entry->{$column['function_name']}(); | |
| 5 | 5 | ?> | 
| 6 | 6 | </td> | 
| 7 | 7 | \ No newline at end of file | 
| @@ -20,42 +20,42 @@ discard block | ||
| 20 | 20 | |
| 21 | 21 |  @section('content') | 
| 22 | 22 | <?php | 
| 23 | - function tree_element($entry, $key, $all_entries, $crud) | |
| 24 | -  { | |
| 23 | + function tree_element($entry, $key, $all_entries, $crud) | |
| 24 | +    { | |
| 25 | 25 |      if (!isset($entry->tree_element_shown)) { | 
| 26 | - // mark the element as shown | |
| 27 | - $all_entries[$key]->tree_element_shown = true; | |
| 28 | - $entry->tree_element_shown = true; | |
| 26 | + // mark the element as shown | |
| 27 | + $all_entries[$key]->tree_element_shown = true; | |
| 28 | + $entry->tree_element_shown = true; | |
| 29 | 29 | |
| 30 | - // show the tree element | |
| 31 | - echo '<li id="list_'.$entry->getKey().'">'; | |
| 32 | -      echo '<div><span class="disclose"><span></span></span>'.$entry->{$crud->reorder_label}.'</div>'; | |
| 30 | + // show the tree element | |
| 31 | + echo '<li id="list_'.$entry->getKey().'">'; | |
| 32 | +        echo '<div><span class="disclose"><span></span></span>'.$entry->{$crud->reorder_label}.'</div>'; | |
| 33 | 33 | |
| 34 | - // see if this element has any children | |
| 35 | - $children = []; | |
| 36 | -      foreach ($all_entries as $key => $subentry) { | |
| 34 | + // see if this element has any children | |
| 35 | + $children = []; | |
| 36 | +        foreach ($all_entries as $key => $subentry) { | |
| 37 | 37 |          if ($subentry->parent_id == $entry->getKey()) { | 
| 38 | - $children[] = $subentry; | |
| 38 | + $children[] = $subentry; | |
| 39 | + } | |
| 39 | 40 | } | 
| 40 | - } | |
| 41 | 41 | |
| 42 | -      $children = collect($children)->sortBy('lft'); | |
| 42 | +        $children = collect($children)->sortBy('lft'); | |
| 43 | 43 | |
| 44 | - // if it does have children, show them | |
| 45 | -      if (count($children)) { | |
| 44 | + // if it does have children, show them | |
| 45 | +        if (count($children)) { | |
| 46 | 46 | echo '<ol>'; | 
| 47 | 47 |          foreach ($children as $key => $child) { | 
| 48 | - $children[$key] = tree_element($child, $child->getKey(), $all_entries, $crud); | |
| 48 | + $children[$key] = tree_element($child, $child->getKey(), $all_entries, $crud); | |
| 49 | 49 | } | 
| 50 | 50 | echo '</ol>'; | 
| 51 | - } | |
| 52 | - echo '</li>'; | |
| 51 | + } | |
| 52 | + echo '</li>'; | |
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 | return $entry; | 
| 56 | - } | |
| 56 | + } | |
| 57 | 57 | |
| 58 | - ?> | |
| 58 | + ?> | |
| 59 | 59 | <div class="row"> | 
| 60 | 60 | <div class="col-md-8 col-md-offset-2"> | 
| 61 | 61 |      @if ($crud->hasAccess('list')) | 
| @@ -73,15 +73,15 @@ discard block | ||
| 73 | 73 | |
| 74 | 74 | <ol class="sortable"> | 
| 75 | 75 | <?php | 
| 76 | -              $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName()); | |
| 77 | -              $root_entries = $all_entries->filter(function($item) { | |
| 76 | +                $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName()); | |
| 77 | +                $root_entries = $all_entries->filter(function($item) { | |
| 78 | 78 | return $item->parent_id == 0; | 
| 79 | - }); | |
| 80 | - ?> | |
| 79 | + }); | |
| 80 | + ?> | |
| 81 | 81 | @foreach ($root_entries as $key => $entry) | 
| 82 | 82 | <?php | 
| 83 | 83 | $root_entries[$key] = tree_element($entry, $key, $all_entries, $crud); | 
| 84 | - ?> | |
| 84 | + ?> | |
| 85 | 85 | @endforeach | 
| 86 | 86 | </ol> | 
| 87 | 87 | |
| @@ -89,33 +89,33 @@ | ||
| 89 | 89 | Route::post($name.'/search', [ | 
| 90 | 90 | 'as' => 'crud.'.$name.'.search', | 
| 91 | 91 | 'uses' => $controller.'@search', | 
| 92 | - ]); | |
| 92 | + ]); | |
| 93 | 93 | Route::get($name.'/reorder', [ | 
| 94 | 94 | 'as' => 'crud.'.$name.'.reorder', | 
| 95 | 95 | 'uses' => $controller.'@reorder', | 
| 96 | - ]); | |
| 96 | + ]); | |
| 97 | 97 | Route::post($name.'/reorder', [ | 
| 98 | 98 | 'as' => 'crud.'.$name.'.save.reorder', | 
| 99 | 99 | 'uses' => $controller.'@saveReorder', | 
| 100 | - ]); | |
| 100 | + ]); | |
| 101 | 101 |          Route::get($name.'/{id}/details', [ | 
| 102 | 102 | 'as' => 'crud.'.$name.'.showDetailsRow', | 
| 103 | 103 | 'uses' => $controller.'@showDetailsRow', | 
| 104 | - ]); | |
| 104 | + ]); | |
| 105 | 105 |          Route::get($name.'/{id}/translate/{lang}', [ | 
| 106 | 106 | 'as' => 'crud.'.$name.'.translateItem', | 
| 107 | 107 | 'uses' => $controller.'@translateItem', | 
| 108 | - ]); | |
| 108 | + ]); | |
| 109 | 109 | |
| 110 | 110 |          Route::get($name.'/{id}/revisions', [ | 
| 111 | 111 | 'as' => 'crud.'.$name.'.listRevisions', | 
| 112 | 112 | 'uses' => $controller.'@listRevisions', | 
| 113 | - ]); | |
| 113 | + ]); | |
| 114 | 114 | |
| 115 | 115 |          Route::post($name.'/{id}/revisions/{revisionId}/restore', [ | 
| 116 | 116 | 'as' => 'crud.'.$name.'.restoreRevision', | 
| 117 | 117 | 'uses' => $controller.'@restoreRevision', | 
| 118 | - ]); | |
| 118 | + ]); | |
| 119 | 119 | |
| 120 | 120 | $options_with_default_route_names = array_merge([ | 
| 121 | 121 | 'names' => [ | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 |  {{-- enumerate the values in an array  --}} | 
| 2 | 2 | <td> | 
| 3 | 3 | <?php | 
| 4 | -    	$value = $entry->{$column['name']}; | |
| 5 | - // the value should be an array wether or not attribute casting is used | |
| 6 | -    	if (!is_array($value)) { | |
| 7 | - $value = json_decode($value, true); | |
| 8 | - } | |
| 4 | +        $value = $entry->{$column['name']}; | |
| 5 | + // the value should be an array wether or not attribute casting is used | |
| 6 | +        if (!is_array($value)) { | |
| 7 | + $value = json_decode($value, true); | |
| 8 | + } | |
| 9 | 9 |          if ($value && count($value)) { | 
| 10 | 10 |              echo implode(', ', $value); | 
| 11 | 11 |          } else { | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 |  {{-- enumerate the values in an array  --}} | 
| 2 | 2 | <td> | 
| 3 | 3 | <?php | 
| 4 | -    	$array = $entry->{$column['name']}; | |
| 5 | - // the value should be an array wether or not attribute casting is used | |
| 6 | -    	if (!is_array($array)) { | |
| 7 | - $array = json_decode($array, true); | |
| 8 | - } | |
| 4 | +        $array = $entry->{$column['name']}; | |
| 5 | + // the value should be an array wether or not attribute casting is used | |
| 6 | +        if (!is_array($array)) { | |
| 7 | + $array = json_decode($array, true); | |
| 8 | + } | |
| 9 | 9 |          if ($array && count($array)) { | 
| 10 | 10 | echo count($array).' items'; | 
| 11 | 11 |          } else { | 
| @@ -12,8 +12,7 @@ | ||
| 12 | 12 |      if(is_array($items)) { | 
| 13 | 13 |          if (count($items)) { | 
| 14 | 14 | $items = json_encode($items); | 
| 15 | - } | |
| 16 | - else | |
| 15 | + } else | |
| 17 | 16 |          { | 
| 18 | 17 | $items = '[]'; | 
| 19 | 18 | } |