RegisterClientRequest.php 867 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. use Illuminate\Validation\Rule;
  5. class RegisterClientRequest extends FormRequest
  6. {
  7. public function rules(): array
  8. {
  9. $rules = [
  10. 'email' => 'sometimes|email',
  11. 'phone' => 'sometimes|string|nullable',
  12. 'name' => 'required|string|max:255',
  13. 'code' => 'required|string|max:6',
  14. 'document' => [
  15. 'sometimes',
  16. 'string',
  17. ],
  18. 'zip_code' => 'sometimes|string|max:20',
  19. 'address' => 'sometimes|string|max:255',
  20. 'has_complement' => 'sometimes|boolean',
  21. 'nickname' => 'sometimes|string|max:255',
  22. 'instructions' => 'sometimes|string|max:255',
  23. 'address_type' => 'sometimes|string|max:255',
  24. 'city' => 'sometimes|string|max:255',
  25. 'state' => 'sometimes|string|max:255',
  26. ];
  27. return $rules;
  28. }
  29. }