/** * 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; }
/** * 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); }
public function testCamelToRegularCase() { $this->assertEquals(Str::camelToRegularCase("helloWorldThisIsATest"), "hello world this is a test"); }