@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $value = $this->getValue(); |
15 | 15 | |
16 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists() and empty($value)) { |
|
16 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists() and empty($value)) { |
|
17 | 17 | return; |
18 | 18 | } |
19 | 19 | |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | { |
28 | 28 | $data = parent::getValidationRules(); |
29 | 29 | |
30 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists()) { |
|
30 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists()) { |
|
31 | 31 | foreach ($data as $field => $rules) { |
32 | 32 | foreach ($rules as $i => $rule) { |
33 | 33 | if ($rule == 'required') { |
34 | - unset($data[$field][$i]); |
|
34 | + unset($data[ $field ][ $i ]); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function hashWithBcrypt() |
65 | 65 | { |
66 | - return $this->mutateValue(function ($value) { |
|
66 | + return $this->mutateValue(function($value) { |
|
67 | 67 | return bcrypt($value); |
68 | 68 | }); |
69 | 69 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function hashWithMD5() |
75 | 75 | { |
76 | - return $this->mutateValue(function ($value) { |
|
76 | + return $this->mutateValue(function($value) { |
|
77 | 77 | return md5($value); |
78 | 78 | }); |
79 | 79 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function hashWithSHA1() |
85 | 85 | { |
86 | - return $this->mutateValue(function ($value) { |
|
86 | + return $this->mutateValue(function($value) { |
|
87 | 87 | return sha1($value); |
88 | 88 | }); |
89 | 89 | } |
@@ -91,7 +91,7 @@ |
||
91 | 91 | */ |
92 | 92 | public function getConditionAttributes(Model $model) |
93 | 93 | { |
94 | - $temp = $this->attributeCondition ? call_user_func($this->attributeCondition, $model) : []; |
|
94 | + $temp = $this->attributeCondition ? call_user_func($this->attributeCondition, $model) : [ ]; |
|
95 | 95 | |
96 | 96 | if ($temp) { |
97 | 97 | foreach ($temp as $key => $value) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function set($filters) |
42 | 42 | { |
43 | - if (! is_array($filters)) { |
|
43 | + if (!is_array($filters)) { |
|
44 | 44 | $filters = func_get_args(); |
45 | 45 | } |
46 | 46 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getActive() |
80 | 80 | { |
81 | - return $this->filters->filter(function (FilterInterface $filter) { |
|
81 | + return $this->filters->filter(function(FilterInterface $filter) { |
|
82 | 82 | return $filter->isActive(); |
83 | 83 | }); |
84 | 84 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
126 | 126 | { |
127 | - $this->getActive()->each(function (FilterInterface $filter) use ($query) { |
|
127 | + $this->getActive()->each(function(FilterInterface $filter) use ($query) { |
|
128 | 128 | $filter->apply($query); |
129 | 129 | }); |
130 | 130 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function initialize() |
136 | 136 | { |
137 | - $this->filters->each(function (FilterInterface $filter) { |
|
137 | + $this->filters->each(function(FilterInterface $filter) { |
|
138 | 138 | $filter->initialize(); |
139 | 139 | }); |
140 | 140 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $this->setName($name); |
37 | 37 | |
38 | - if (! is_null($title)) { |
|
38 | + if (!is_null($title)) { |
|
39 | 39 | $this->setTitle($title); |
40 | 40 | } |
41 | 41 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getAlias() |
79 | 79 | { |
80 | - if (! $this->alias) { |
|
80 | + if (!$this->alias) { |
|
81 | 81 | return $this->getName(); |
82 | 82 | } |
83 | 83 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | return call_user_func($this->title, $this->getValue()); |
110 | 110 | } |
111 | 111 | |
112 | - return strtr($this->title, [':value' => $this->getValue()]); |
|
112 | + return strtr($this->title, [ ':value' => $this->getValue() ]); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -149,6 +149,6 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function isActive() |
151 | 151 | { |
152 | - return ! is_null($this->getValue()); |
|
152 | + return !is_null($this->getValue()); |
|
153 | 153 | } |
154 | 154 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $dates = explode('::', $date); |
38 | 38 | |
39 | 39 | foreach ($dates as $i => $date) { |
40 | - $dates[$i] = parent::parserValue($date); |
|
40 | + $dates[ $i ] = parent::parserValue($date); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return $dates; |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | |
119 | 119 | $name = $column->getName(); |
120 | 120 | |
121 | - if (! empty($from) && ! empty($to)) { |
|
121 | + if (!empty($from) && !empty($to)) { |
|
122 | 122 | $this->setOperator('between'); |
123 | - $search = [$from, $to]; |
|
124 | - } elseif (! empty($from)) { |
|
123 | + $search = [ $from, $to ]; |
|
124 | + } elseif (!empty($from)) { |
|
125 | 125 | $this->setOperator('greater_or_equal'); |
126 | 126 | $search = $from; |
127 | - } elseif (! empty($to)) { |
|
127 | + } elseif (!empty($to)) { |
|
128 | 128 | $this->setOperator('less_or_equal'); |
129 | 129 | $search = $to; |
130 | 130 | } else { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $parts = explode('.', $name); |
138 | 138 | $fieldName = array_pop($parts); |
139 | 139 | $relationName = implode('.', $parts); |
140 | - $query->whereHas($relationName, function ($q) use ($search, $fieldName) { |
|
140 | + $query->whereHas($relationName, function($q) use ($search, $fieldName) { |
|
141 | 141 | $this->buildQuery($q, $fieldName, $search); |
142 | 142 | }); |
143 | 143 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | */ |
53 | 53 | protected function callCallable(Builder $query, $direction) |
54 | 54 | { |
55 | - call_user_func_array($this->name, [$query, $direction]); |
|
55 | + call_user_func_array($this->name, [ $query, $direction ]); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | { |
65 | 65 | parent::initialize(); |
66 | 66 | |
67 | - $this->buttons->put('edit', $button = new ControlLink(function (Model $model) { |
|
67 | + $this->buttons->put('edit', $button = new ControlLink(function(Model $model) { |
|
68 | 68 | return $this->getModelConfiguration()->getEditUrl($model->getKey()); |
69 | 69 | }, trans('sleeping_owl::lang.table.edit'), 100)); |
70 | 70 | $button->hideText(); |
71 | - $button->setCondition(function () { |
|
71 | + $button->setCondition(function() { |
|
72 | 72 | return $this->isEditable(); |
73 | 73 | }); |
74 | 74 | $button->setIcon('fa fa-pencil'); |
75 | 75 | $button->setHtmlAttribute('class', 'btn-primary'); |
76 | 76 | |
77 | - $this->buttons->put('delete', $button = new ControlButton(function (Model $model) { |
|
77 | + $this->buttons->put('delete', $button = new ControlButton(function(Model $model) { |
|
78 | 78 | return $this->getModelConfiguration()->getDeleteUrl($model->getKey()); |
79 | 79 | }, trans('sleeping_owl::lang.table.delete'), 200)); |
80 | - $button->setCondition(function () { |
|
80 | + $button->setCondition(function() { |
|
81 | 81 | return $this->isDeletable(); |
82 | 82 | }); |
83 | 83 | |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | $button->setIcon('fa fa-trash'); |
87 | 87 | $button->setHtmlAttribute('class', 'btn-danger btn-delete'); |
88 | 88 | |
89 | - $this->buttons->put('destroy', $button = new ControlButton(function (Model $model) { |
|
89 | + $this->buttons->put('destroy', $button = new ControlButton(function(Model $model) { |
|
90 | 90 | return $this->getModelConfiguration()->getDestroyUrl($model->getKey()); |
91 | 91 | }, trans('sleeping_owl::lang.table.destroy'), 300)); |
92 | - $button->setCondition(function () { |
|
92 | + $button->setCondition(function() { |
|
93 | 93 | return $this->isDestroyable(); |
94 | 94 | }); |
95 | 95 | |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | $button->setIcon('fa fa-trash'); |
99 | 99 | $button->setHtmlAttribute('class', 'btn-danger btn-destroy'); |
100 | 100 | |
101 | - $this->buttons->put('restore', $button = new ControlButton(function (Model $model) { |
|
101 | + $this->buttons->put('restore', $button = new ControlButton(function(Model $model) { |
|
102 | 102 | return $this->getModelConfiguration()->getRestoreUrl($model->getKey()); |
103 | 103 | }, trans('sleeping_owl::lang.table.restore'), 400)); |
104 | - $button->setCondition(function () { |
|
104 | + $button->setCondition(function() { |
|
105 | 105 | return $this->isRestorable(); |
106 | 106 | }); |
107 | 107 | $button->hideText(); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | return |
190 | 190 | $this->editable |
191 | 191 | && |
192 | - ! $this->isTrashed() |
|
192 | + !$this->isTrashed() |
|
193 | 193 | && |
194 | 194 | $this->getModelConfiguration()->isEditable( |
195 | 195 | $this->getModel() |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | return |
207 | 207 | $this->deletable |
208 | 208 | && |
209 | - ! $this->isTrashed() |
|
209 | + !$this->isTrashed() |
|
210 | 210 | && |
211 | 211 | $this->getModelConfiguration()->isDeletable( |
212 | 212 | $this->getModel() |
@@ -266,13 +266,13 @@ discard block |
||
266 | 266 | { |
267 | 267 | return parent::toArray() + [ |
268 | 268 | 'buttons' => $this->buttons |
269 | - ->each(function (ControlButtonInterface $button) { |
|
269 | + ->each(function(ControlButtonInterface $button) { |
|
270 | 270 | $button->setModel($this->getModel()); |
271 | 271 | }) |
272 | - ->filter(function (ControlButtonInterface $button) { |
|
272 | + ->filter(function(ControlButtonInterface $button) { |
|
273 | 273 | return $button->isActive(); |
274 | 274 | }) |
275 | - ->sortBy(function (ControlButtonInterface $button) { |
|
275 | + ->sortBy(function(ControlButtonInterface $button) { |
|
276 | 276 | return $button->getPosition(); |
277 | 277 | }), |
278 | 278 | ]; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | $value = $this->getValue(); |
13 | 13 | |
14 | - if (! $this->hasClassProperty('label-', 'bg-')) { |
|
14 | + if (!$this->hasClassProperty('label-', 'bg-')) { |
|
15 | 15 | $this->setHtmlAttribute('class', 'label-primary'); |
16 | 16 | } |
17 | 17 |