@@ -211,7 +211,7 @@ |
||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | // Label |
| 214 | - $label = $menuLink->type === 'module' ? uctrans($menuLink->label, $module) : uctrans($menuLink->label, $this->module);; |
|
| 214 | + $label = $menuLink->type === 'module' ? uctrans($menuLink->label, $module) : uctrans($menuLink->label, $this->module); ; |
|
| 215 | 215 | |
| 216 | 216 | // Icon |
| 217 | 217 | if ($menuLink->type === 'folder') { |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | {{-- Badge --}} |
| 23 | 23 | <?php |
| 24 | 24 | $relatedModule = $relatedlist->relatedModule; |
| 25 | - $countMethod = $relatedlist->method . 'Count'; |
|
| 25 | + $countMethod = $relatedlist->method.'Count'; |
|
| 26 | 26 | |
| 27 | 27 | $model = new $relatedModule->model_class; |
| 28 | 28 | $count = $model->$countMethod($relatedlist, $record->id); |
@@ -294,7 +294,7 @@ |
||
| 294 | 294 | * @param string $type |
| 295 | 295 | * @return array |
| 296 | 296 | */ |
| 297 | - public function getDatatableColumns(Module $module, $filterId=null, $type='list'): array |
|
| 297 | + public function getDatatableColumns(Module $module, $filterId = null, $type = 'list'): array |
|
| 298 | 298 | { |
| 299 | 299 | $columns = [ ]; |
| 300 | 300 | |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | |
| 67 | 67 | if ($this->data->package ?? false) { |
| 68 | 68 | $packageParts = explode('/', $this->data->package); |
| 69 | - $package = $packageParts[count($packageParts)-1].'::'; |
|
| 69 | + $package = $packageParts[ count($packageParts) - 1 ].'::'; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | return $package; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | parent::boot(); |
| 21 | 21 | |
| 22 | 22 | // Bind domain |
| 23 | - Route::bind('domain', function ($value) { |
|
| 23 | + Route::bind('domain', function($value) { |
|
| 24 | 24 | if (preg_match('`[0-9]+`', $value)) { // By id |
| 25 | 25 | $domain = Domain::findOrFail($value); |
| 26 | 26 | } else { // By slug |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | }); |
| 31 | 31 | |
| 32 | 32 | // Bind module |
| 33 | - Route::bind('module', function ($value) { |
|
| 33 | + Route::bind('module', function($value) { |
|
| 34 | 34 | if (preg_match('`[0-9]+`', $value)) { // By id |
| 35 | 35 | $module = Module::findOrFail($value); |
| 36 | 36 | } else { // By name |
@@ -190,7 +190,7 @@ |
||
| 190 | 190 | |
| 191 | 191 | // Add order if needed |
| 192 | 192 | if (!empty($this->order)) { |
| 193 | - foreach($this->order as $fieldColumn => $order) { |
|
| 193 | + foreach ($this->order as $fieldColumn => $order) { |
|
| 194 | 194 | $query = $query->orderBy($fieldColumn, $order); |
| 195 | 195 | } |
| 196 | 196 | } |
@@ -27,19 +27,19 @@ |
||
| 27 | 27 | public function run() |
| 28 | 28 | { |
| 29 | 29 | // Get module |
| 30 | - $module = ucmodule($this->config['module']); |
|
| 30 | + $module = ucmodule($this->config[ 'module' ]); |
|
| 31 | 31 | |
| 32 | 32 | // Get record |
| 33 | 33 | $modelClass = $module->model_class; |
| 34 | - $record = $modelClass::find($this->config['record_id']); |
|
| 34 | + $record = $modelClass::find($this->config[ 'record_id' ]); |
|
| 35 | 35 | |
| 36 | 36 | return view('uccello::widgets.summary_fields', [ |
| 37 | 37 | 'config' => $this->config, |
| 38 | - 'domain' => ucdomain($this->config['domain']), |
|
| 38 | + 'domain' => ucdomain($this->config[ 'domain' ]), |
|
| 39 | 39 | 'module' => $module, |
| 40 | - 'data' => (object) $this->config['data'], |
|
| 40 | + 'data' => (object)$this->config[ 'data' ], |
|
| 41 | 41 | 'record' => $record, |
| 42 | - 'label' => $this->config['data']->label ?? $this->config['labelForTranslation'], |
|
| 42 | + 'label' => $this->config[ 'data' ]->label ?? $this->config[ 'labelForTranslation' ], |
|
| 43 | 43 | ]); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -20,19 +20,19 @@ |
||
| 20 | 20 | public function run() |
| 21 | 21 | { |
| 22 | 22 | // Get module |
| 23 | - $module = ucmodule($this->config['module']); |
|
| 23 | + $module = ucmodule($this->config[ 'module' ]); |
|
| 24 | 24 | |
| 25 | 25 | // Get record |
| 26 | 26 | $modelClass = $module->model_class; |
| 27 | - $record = $modelClass::find($this->config['record_id']); |
|
| 27 | + $record = $modelClass::find($this->config[ 'record_id' ]); |
|
| 28 | 28 | |
| 29 | 29 | return view('uccello::widgets.relatedlist', [ |
| 30 | 30 | 'config' => $this->config, |
| 31 | - 'domain' => ucdomain($this->config['domain']), |
|
| 31 | + 'domain' => ucdomain($this->config[ 'domain' ]), |
|
| 32 | 32 | 'module' => $module, |
| 33 | - 'data' => (object) $this->config['data'], |
|
| 33 | + 'data' => (object)$this->config[ 'data' ], |
|
| 34 | 34 | 'record' => $record, |
| 35 | - 'label' => $this->config['data']->label ?? $this->config['labelForTranslation'], |
|
| 35 | + 'label' => $this->config[ 'data' ]->label ?? $this->config[ 'labelForTranslation' ], |
|
| 36 | 36 | ]); |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -48,9 +48,9 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public function addConditionToSearchQuery(Builder $query, Field $field, $value) : Builder |
| 50 | 50 | { |
| 51 | - $query->where(function ($query) use($field, $value) { |
|
| 51 | + $query->where(function($query) use($field, $value) { |
|
| 52 | 52 | $values = explode(',', $value); // Start Date, End Date |
| 53 | - $query->whereBetween($field->column, [ trim($values[0]), trim($values[1]) ])->get(); |
|
| 53 | + $query->whereBetween($field->column, [ trim($values[ 0 ]), trim($values[ 1 ]) ])->get(); |
|
| 54 | 54 | }); |
| 55 | 55 | |
| 56 | 56 | return $query; |