File manager - Edit - /var/www/html/portalHomolog/app/Http/Requests/ParquesJardinsRequest.php
Back
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Str; class ParquesJardinsRequest extends FormRequest { public function authorize(): bool { return true; } public function rules(): array { return [ "nome" => 'nullable|string|max:255', "lei" => 'nullable|string|max:255', "area" => 'nullable|string|max:255', "perimetro" => 'nullable|string|max:255', 'telefone' => 'nullable|string|max:255', 'email' => 'nullable|email|max:255', 'foto' => 'nullable|image|mimes:jpeg,png,jpg,gif|mimetypes:image/jpeg,image/png,image/gif|max:102400', 'domicilio' => 'required|string', 'cep' => 'required|string|max:10', 'logradouro' => 'required|string|max:255', 'numero' => 'nullable|string|max:20', 'complemento' => 'nullable|string|max:255', 'bairro' => 'required|string|max:255', 'cidade' => 'required|string|max:255', 'uf' => 'required|string|size:2', 'latitude' => 'nullable|numeric|between:-90,90', 'longitude' => 'nullable|numeric|between:-180,180', ]; } public function messages(): array { return [ 'foto.mimes' => '* Os formatos de imagem permitidos são: jpeg,png,jpg,gif', 'foto.mimetypes' => '* Os formatos de imagem permitidos são: jpeg,png,jpg,gif', 'foto.max' => '* O tamanho da imagem não pode exceder 100 megabytes (MB).', 'nome.required' => 'O nome completo é obrigatório.', 'telefone.max' => 'O campo telefone possui mais de 255 caracteres.', 'domicilio.required' => 'O tipo de domicílio é obrigatório.', 'cep.required' => 'O CEP é obrigatório.', 'logradouro.required' => 'O logradouro é obrigatório.', 'bairro.required' => 'O bairro é obrigatório.', 'cidade.required' => 'A cidade é obrigatória.', 'uf.required' => 'O estado (UF) é obrigatório.', ]; } protected function prepareForValidation(): void { $implode = null; if (isset($this->atributos)) { foreach ($this->atributos as $name => $value) { $implode[] = $value; } $implode = implode(",", $implode); } $this->merge([ 'slug' => Str::slug($this->nome), 'atributos' => $implode, ]); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings