We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -87,7 +87,7 @@ |
||
87 | 87 | { |
88 | 88 | $all_relation_fields = $this->getRelationFields($form); |
89 | 89 | |
90 | - return array_where($all_relation_fields, function ($value, $key) { |
|
90 | + return array_where($all_relation_fields, function($value, $key) { |
|
91 | 91 | return isset($value['pivot']) && $value['pivot']; |
92 | 92 | }); |
93 | 93 | } |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\ModelTraits\SpatieTranslatable; |
4 | 4 | |
5 | -use Illuminate\Database\Eloquent\Model; |
|
6 | 5 | use Illuminate\Contracts\Events\Dispatcher; |
6 | +use Illuminate\Database\Eloquent\Model; |
|
7 | 7 | |
8 | 8 | class SluggableObserver extends \Cviebrock\EloquentSluggable\SluggableObserver |
9 | 9 | { |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | protected function makeSlugUnique($slug, array $config, $attribute) |
51 | 51 | { |
52 | - if (! $config['unique']) { |
|
52 | + if (!$config['unique']) { |
|
53 | 53 | return $slug; |
54 | 54 | } |
55 | 55 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $separator = $config['separator']; |
48 | 48 | $attribute = $attribute.'->'.$this->getLocale(); |
49 | 49 | |
50 | - return $query->where(function (Builder $q) use ($attribute, $slug, $separator) { |
|
50 | + return $query->where(function(Builder $q) use ($attribute, $slug, $separator) { |
|
51 | 51 | $q->where($attribute, '=', $slug) |
52 | 52 | ->orWhere($attribute, 'LIKE', $slug.$separator.'%'); |
53 | 53 | }); |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\ModelTraits\SpatieTranslatable; |
4 | 4 | |
5 | -use Illuminate\Database\Eloquent\Model; |
|
6 | -use Illuminate\Database\Eloquent\Builder; |
|
7 | 5 | use Cviebrock\EloquentSluggable\Sluggable as OriginalSluggable; |
6 | +use Illuminate\Database\Eloquent\Builder; |
|
7 | +use Illuminate\Database\Eloquent\Model; |
|
8 | 8 | |
9 | 9 | trait Sluggable |
10 | 10 | { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function getAttributeValue($key) |
26 | 26 | { |
27 | - if (! $this->isTranslatableAttribute($key)) { |
|
27 | + if (!$this->isTranslatableAttribute($key)) { |
|
28 | 28 | return parent::getAttributeValue($key); |
29 | 29 | } |
30 | 30 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function update(array $attributes = [], array $options = []) |
74 | 74 | { |
75 | - if (! $this->exists) { |
|
75 | + if (!$this->exists) { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | // if the label is missing, we should set it |
27 | - if (! isset($complete_field_array['label'])) { |
|
27 | + if (!isset($complete_field_array['label'])) { |
|
28 | 28 | $complete_field_array['label'] = ucfirst($complete_field_array['name']); |
29 | 29 | } |
30 | 30 | |
31 | 31 | // if the field type is missing, we should set it |
32 | - if (! isset($complete_field_array['type'])) { |
|
32 | + if (!isset($complete_field_array['type'])) { |
|
33 | 33 | $complete_field_array['type'] = $this->getFieldTypeFromDbColumnType($complete_field_array['name']); |
34 | 34 | } |
35 | 35 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function removeFields($array_of_names, $form = 'both') |
141 | 141 | { |
142 | - if (! empty($array_of_names)) { |
|
142 | + if (!empty($array_of_names)) { |
|
143 | 143 | foreach ($array_of_names as $name) { |
144 | 144 | $this->removeField($name, $form); |
145 | 145 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $jsonCastables = ['array', 'object', 'json']; |
202 | 202 | $fieldCasting = $casted_attributes[$field['name']]; |
203 | 203 | |
204 | - if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) { |
|
204 | + if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) { |
|
205 | 205 | try { |
206 | 206 | $data[$field['name']] = json_decode($data[$field['name']]); |
207 | 207 | } catch (Exception $e) { |
@@ -3,33 +3,33 @@ discard block |
||
3 | 3 | <label>{!! $field['label'] !!}</label> |
4 | 4 | @include('crud::inc.field_translatable_icon') |
5 | 5 | <?php |
6 | - $entity_model = $crud->getModel(); |
|
6 | + $entity_model = $crud->getModel(); |
|
7 | 7 | |
8 | - //short name for dependency fields |
|
9 | - $primary_dependency = $field['subfields']['primary']; |
|
10 | - $secondary_dependency = $field['subfields']['secondary']; |
|
8 | + //short name for dependency fields |
|
9 | + $primary_dependency = $field['subfields']['primary']; |
|
10 | + $secondary_dependency = $field['subfields']['secondary']; |
|
11 | 11 | |
12 | 12 | |
13 | - //all items with relation |
|
14 | - $dependencies = $primary_dependency['model']::with($primary_dependency['entity_secondary'])->get(); |
|
13 | + //all items with relation |
|
14 | + $dependencies = $primary_dependency['model']::with($primary_dependency['entity_secondary'])->get(); |
|
15 | 15 | |
16 | - $dependencyArray = []; |
|
16 | + $dependencyArray = []; |
|
17 | 17 | |
18 | - //convert dependency array to simple matrix ( prymary id as key and array with secondaries id ) |
|
19 | - foreach($dependencies as $primary){ |
|
20 | - $dependencyArray[$primary->id] = []; |
|
18 | + //convert dependency array to simple matrix ( prymary id as key and array with secondaries id ) |
|
19 | + foreach($dependencies as $primary){ |
|
20 | + $dependencyArray[$primary->id] = []; |
|
21 | 21 | foreach($primary->{$primary_dependency['entity_secondary']} as $secondary){ |
22 | 22 | $dependencyArray[$primary->id][] = $secondary->id; |
23 | 23 | } |
24 | - } |
|
24 | + } |
|
25 | 25 | |
26 | - //for update form, get initial state of the entity |
|
27 | - if( isset($id) && $id ){ |
|
26 | + //for update form, get initial state of the entity |
|
27 | + if( isset($id) && $id ){ |
|
28 | 28 | |
29 | 29 | //get entity with relations for primary dependency |
30 | 30 | $entity_dependencies = $entity_model->with($primary_dependency['entity']) |
31 | - ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) |
|
32 | - ->find($id); |
|
31 | + ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) |
|
32 | + ->find($id); |
|
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 !!}; |