Пример #1
0
 /**
  * Compare two properties for equality
  * @param $property string The first property to compare
  * @param $value string The second property to compare
  * @return $this Validator Current validator for chaining
  */
 public function isSameAs($property, $value)
 {
     if ($this->hasProperty($value) && $this->data[$value] != $this->data[$property]) {
         $this->addError($property, "must be the same as " . Str::camelToTitleCase($value));
     }
     return $this;
 }
Пример #2
0
 /**
  * Format the validation message
  * @param $property string Property to format
  * @return string Formatted validation message
  */
 protected function formatValidationMessage($property)
 {
     return Str::camelToTitleCase($property) . " " . $this->extractValidationMessage($property);
 }
Пример #3
0
 public function testCamelToTitleCase()
 {
     $this->assertEquals(Str::camelToTitleCase("helloWorldThisIsATest"), "Hello World This Is A Test");
 }