|
@@ -38,7 +38,7 @@ discard block |
|
|
block discarded – undo |
|
38
|
38
|
return str_replace(array_keys($array), array_values($array), $stub); |
|
39
|
39
|
} |
|
40
|
40
|
|
|
41
|
|
- protected function parseBlade($stub){ |
|
|
41
|
+ protected function parseBlade($stub) { |
|
42
|
42
|
$modelNamespace = $this->parseModel($this->getConfig('model')); |
|
43
|
43
|
$modelName = $this->getModelName($modelNamespace); |
|
44
|
44
|
$array = [ |
|
@@ -61,10 +61,10 @@ discard block |
|
|
block discarded – undo |
|
61
|
61
|
return $this->qualifyModel($model); |
|
62
|
62
|
} |
|
63
|
63
|
|
|
64
|
|
- protected function getConfig($key){ |
|
|
64
|
+ protected function getConfig($key) { |
|
65
|
65
|
$action = $this->getNameInput(); |
|
66
|
66
|
|
|
67
|
|
- if(config('easy_panel.actions.'.$action.'.'.$key)){ |
|
|
67
|
+ if (config('easy_panel.actions.'.$action.'.'.$key)) { |
|
68
|
68
|
return config('easy_panel.actions.'.$action.'.'.$key); |
|
69
|
69
|
} |
|
70
|
70
|
|
|
@@ -117,11 +117,11 @@ discard block |
|
|
block discarded – undo |
|
117
|
117
|
{ |
|
118
|
118
|
$str = ''; |
|
119
|
119
|
foreach ($fields as $key => $field) { |
|
120
|
|
- $str .= $field != end($fields) ? "'$key' => " . '$this' . "->$key,".$this->makeTab(3) : "'$key' => " . '$this' . "->$key,"; |
|
|
120
|
+ $str .= $field != end($fields) ? "'$key' => ".'$this'."->$key,".$this->makeTab(3) : "'$key' => ".'$this'."->$key,"; |
|
121
|
121
|
} |
|
122
|
122
|
|
|
123
|
123
|
$model = $this->getNameInput(); |
|
124
|
|
- if(config("easy_panel.actions.$model.extra_values")){ |
|
|
124
|
+ if (config("easy_panel.actions.$model.extra_values")) { |
|
125
|
125
|
|
|
126
|
126
|
$str .= $this->parseExtraValues(); |
|
127
|
127
|
} |
|
@@ -129,7 +129,7 @@ discard block |
|
|
block discarded – undo |
|
129
|
129
|
return $str; |
|
130
|
130
|
} |
|
131
|
131
|
|
|
132
|
|
- protected function parseExtraValues(){ |
|
|
132
|
+ protected function parseExtraValues() { |
|
133
|
133
|
$str = ''; |
|
134
|
134
|
|
|
135
|
135
|
$values = $this->getConfig('extra_values'); |
|
@@ -173,7 +173,7 @@ discard block |
|
|
block discarded – undo |
|
173
|
173
|
$str .= '<div class="form-group">'.$this->makeTab(4); |
|
174
|
174
|
$str .= '<label for="input'.$key.'" class="col-sm-2 control-label">'.ucfirst($key).'</label>'.$this->makeTab(4); |
|
175
|
175
|
$str = $this->inputsHTML($type, $key, $str).$this->makeTab(4); |
|
176
|
|
- $str .='@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3); |
|
|
176
|
+ $str .= '@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3); |
|
177
|
177
|
$str .= '</div>'.$this->makeTab(3); |
|
178
|
178
|
} |
|
179
|
179
|
|
|
@@ -183,19 +183,19 @@ discard block |
|
|
block discarded – undo |
|
183
|
183
|
protected function inputsHTML($type, $key, string $str): string |
|
184
|
184
|
{ |
|
185
|
185
|
$array = [ |
|
186
|
|
- 'text' => '<input type="text" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">', |
|
187
|
|
- 'email' => '<input type="email" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">', |
|
188
|
|
- 'number' => '<input type="number" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">', |
|
189
|
|
- 'file' => '<input type="file" wire:model="' . $key . '" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input' . $key . '">', |
|
190
|
|
- 'textarea' => '<textarea wire:model="' . $key . '" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>', |
|
191
|
|
- 'password' => '<input type="password" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">', |
|
|
186
|
+ 'text' => '<input type="text" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">', |
|
|
187
|
+ 'email' => '<input type="email" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">', |
|
|
188
|
+ 'number' => '<input type="number" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">', |
|
|
189
|
+ 'file' => '<input type="file" wire:model="'.$key.'" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input'.$key.'">', |
|
|
190
|
+ 'textarea' => '<textarea wire:model="'.$key.'" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>', |
|
|
191
|
+ 'password' => '<input type="password" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">', |
|
192
|
192
|
]; |
|
193
|
193
|
$str .= $array[$type]; |
|
194
|
194
|
|
|
195
|
195
|
return $str; |
|
196
|
196
|
} |
|
197
|
197
|
|
|
198
|
|
- private function makeTab($count, $newLine = true){ |
|
|
198
|
+ private function makeTab($count, $newLine = true) { |
|
199
|
199
|
$count = $count * 4; |
|
200
|
200
|
$tabs = str_repeat(' ', $count); |
|
201
|
201
|
|