File manager - Edit - /var/www/html/portalHomolog/app/Http/Requests/ProjetosProgramas/ProjetosProgramasHistoricoAndamentoStoreRequest.php
Back
<?php namespace App\Http\Requests\ProjetosProgramas; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; class ProjetosProgramasHistoricoAndamentoStoreRequest extends FormRequest { public function authorize(): bool { return true; } protected function prepareForValidation(): void { if ($this->input('andamento_cor') === '') { $this->merge(['andamento_cor' => null]); } } /** * @return array<string, mixed> */ public function rules(): array { $coresAndamento = ['verde', 'vermelho', 'amarelo']; return [ 'data' => ['nullable', 'date'], 'status' => ['nullable', 'string', 'max:255'], 'texto' => ['required', 'string', 'min:2', 'max:65535'], 'andamento_cor' => ['nullable', Rule::in($coresAndamento)], 'sincronizar_andamento_mapao' => ['nullable', 'in:0,1'], 'anexos' => ['nullable', 'array', 'max:10'], 'anexos.*' => ['file', 'max:51200'], ]; } /** * @return array<string, string> */ public function attributes(): array { return [ 'data' => __('Data'), 'status' => __('Status'), 'texto' => __('Texto'), 'andamento_cor' => __('Legenda do andamento (MAPÃO)'), 'sincronizar_andamento_mapao' => __('Atualizar coluna Andamento no MAPÃO'), 'anexos' => __('Anexos'), 'anexos.*' => __('Anexo'), ]; } /** * @return array<string, string> */ public function messages(): array { return [ 'required' => __('O campo :attribute é obrigatório.'), 'date' => __('Informe uma data válida para :attribute.'), 'min' => __('O campo :attribute deve ter pelo menos :min caracteres.'), 'max' => __('O campo :attribute deve possuir no máximo :max caracteres.'), 'in' => __('O valor selecionado em :attribute é inválido.'), ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings