Exists.php 476 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Illuminate\Validation\Rules;
  3. use Illuminate\Support\Traits\Conditionable;
  4. use Stringable;
  5. class Exists implements Stringable
  6. {
  7. use Conditionable, DatabaseRule;
  8. /**
  9. * Convert the rule to a validation string.
  10. *
  11. * @return string
  12. */
  13. public function __toString()
  14. {
  15. return rtrim(sprintf('exists:%s,%s,%s',
  16. $this->table,
  17. $this->column,
  18. $this->formatWheres()
  19. ), ',');
  20. }
  21. }