File manager - Edit - /var/www/html/portal/app/Http/Requests/UrlRequest.php
Back
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class UrlRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { $url = $this->route("url"); return [ 'source' => ['required', 'regex:/^[a-z0-9\/\-_]+$/i', 'max:100', 'unique:mysql_urls.urls,source,' . ($url ? $url->id : null)], 'destination' => 'required|url|max:500', 'active' => 'sometimes|boolean' ]; } public function messages(): array { return [ 'source.required' => 'O campo caminho é obrigatório.', 'source.regex' => 'O caminho só pode conter letras, números, traços, underscores e barras (/).', 'source.unique' => 'Este caminho já está em uso. Escolha outro.', 'source.max' => 'O caminho não pode ter mais que 100 caracteres.', 'destination.required' => 'A URL de destino é obrigatória.', 'destination.url' => 'Informe uma URL válida.', 'destination.max' => 'A URL não pode ter mais que 500 caracteres.' ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings