ProviderBankAccountUpdateRequest.php 1006 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. use Illuminate\Validation\Rule;
  5. class ProviderBankAccountUpdateRequest extends FormRequest
  6. {
  7. public function authorize(): bool
  8. {
  9. return true;
  10. }
  11. public function rules(): array
  12. {
  13. return [
  14. 'bank_id' => ['sometimes', 'nullable', 'integer', Rule::exists('banks', 'id')->where('active', true)->whereNull('deleted_at')],
  15. 'bank_code' => ['sometimes', 'nullable', 'string', 'max:3'],
  16. 'type' => ['sometimes', Rule::in(['checking', 'savings'])],
  17. 'branch_number' => ['sometimes', 'string', 'max:4'],
  18. 'branch_check_digit' => ['sometimes', 'nullable', 'string', 'max:2'],
  19. 'account_number' => ['sometimes', 'string', 'max:13'],
  20. 'account_check_digit' => ['sometimes', 'string', 'max:2'],
  21. 'is_primary' => ['sometimes', 'boolean'],
  22. ];
  23. }
  24. }