<?php
namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest;
class CreateTransferRequest extends FormRequest {public function authorize():bool{return $this->user()?->can('transfer.create')??false;}public function rules():array{return ['quote_token'=>['required','string'],'sender'=>['required','array'],'sender.name'=>['required','string','min:3','max:80','regex:/^[\pL\s\'\-]+$/u'],'sender.phone'=>['required','string','max:20','regex:/^\+[1-9]\d{7,14}$/'],'sender.id_type'=>['required','string','max:30'],'sender.id_number'=>['required','alpha_num','min:5','max:30'],'sender.address'=>['nullable','string','max:500'],'recipient'=>['required','array'],'recipient.name'=>['required','string','min:3','max:80','regex:/^[\pL\s\'\-]+$/u'],'recipient.phone'=>['required','string','max:20','regex:/^\+[1-9]\d{7,14}$/'],'recipient.city'=>['nullable','string','max:100']];}}
