Validator.php 991B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace Illuminate\Contracts\Validation;
  3. use Illuminate\Contracts\Support\MessageProvider;
  4. interface Validator extends MessageProvider
  5. {
  6. /**
  7. * Determine if the data fails the validation rules.
  8. *
  9. * @return bool
  10. */
  11. public function fails();
  12. /**
  13. * Get the failed validation rules.
  14. *
  15. * @return array
  16. */
  17. public function failed();
  18. /**
  19. * Add conditions to a given field based on a Closure.
  20. *
  21. * @param string $attribute
  22. * @param string|array $rules
  23. * @param callable $callback
  24. * @return $this
  25. */
  26. public function sometimes($attribute, $rules, callable $callback);
  27. /**
  28. * After an after validation callback.
  29. *
  30. * @param callable|string $callback
  31. * @return $this
  32. */
  33. public function after($callback);
  34. /**
  35. * Get all of the validation error messages.
  36. *
  37. * @return \Illuminate\Support\MessageBag
  38. */
  39. public function errors();
  40. }