Skip to content

Instantly share code, notes, and snippets.

@kvn1234
Last active January 22, 2019 02:47
Show Gist options
  • Save kvn1234/16c31778d473e705cb8fb9b43851622b to your computer and use it in GitHub Desktop.
Save kvn1234/16c31778d473e705cb8fb9b43851622b to your computer and use it in GitHub Desktop.
Laravel RegEx for updating a form to show both old values while editing a form
(value\=\"\{\{\ old\(\')([a-z\-\_]+)(\')(\)\ \}\}\")
usage: $1$2$3\,\ \$variableObject\->$2$4
works as long as:
$2 is the same key as the column name (or whatever is in the object coming back)
see https://regex101.com/r/DfQngW/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment