pdv.backend/app/Http/Requests/App/InvoiceRequestRejectRequest.php

39 lines
937 B
PHP

<?php
namespace App\Http\Requests\App;
use Illuminate\Foundation\Http\FormRequest;
class InvoiceRequestRejectRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true; // Autorización manejada por middleware
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'notes' => ['required', 'string', 'min:10', 'max:500'],
];
}
/**
* Get custom messages for validator errors.
*/
public function messages(): array
{
return [
'notes.required' => 'Debe proporcionar una razón para rechazar la solicitud',
'notes.min' => 'La razón debe tener al menos 10 caracteres',
'notes.max' => 'La razón no puede exceder 500 caracteres',
];
}
}