parent
b04a47a4a4
commit
68e9100e57
7 changed files with 81 additions and 3 deletions
|
@ -73,7 +73,7 @@ class EggController extends Controller
|
|||
*/
|
||||
public function store(EggFormRequest $request): RedirectResponse
|
||||
{
|
||||
$data = $request->normalize();
|
||||
$data = $request->validated();
|
||||
$data['docker_images'] = $this->normalizeDockerImages($data['docker_images'] ?? null);
|
||||
|
||||
$egg = $this->creationService->handle($data);
|
||||
|
@ -106,7 +106,7 @@ class EggController extends Controller
|
|||
*/
|
||||
public function update(EggFormRequest $request, Egg $egg): RedirectResponse
|
||||
{
|
||||
$data = $request->normalize();
|
||||
$data = $request->validated();
|
||||
$data['docker_images'] = $this->normalizeDockerImages($data['docker_images'] ?? null);
|
||||
|
||||
$this->updateService->handle($egg, $data);
|
||||
|
|
|
@ -22,6 +22,7 @@ class EggFormRequest extends AdminFormRequest
|
|||
'name' => 'required|string|max:191',
|
||||
'description' => 'nullable|string',
|
||||
'docker_images' => 'required|string',
|
||||
'force_outgoing_ip' => 'sometimes|boolean',
|
||||
'file_denylist' => 'array',
|
||||
'startup' => 'required|string',
|
||||
'config_from' => 'sometimes|bail|nullable|numeric',
|
||||
|
@ -47,4 +48,13 @@ class EggFormRequest extends AdminFormRequest
|
|||
return (int) $this->input('config_from') !== 0;
|
||||
});
|
||||
}
|
||||
|
||||
public function validated(): array
|
||||
{
|
||||
$data = parent::validated();
|
||||
|
||||
return array_merge($data, [
|
||||
'force_outgoing_ip' => array_get($data, 'force_outgoing_ip', false),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue