Skip to content

Instantly share code, notes, and snippets.

@jxlwqq
Last active November 3, 2022 04:11
Show Gist options
  • Save jxlwqq/3687b809d83761db23bc437dc901c104 to your computer and use it in GitHub Desktop.
Save jxlwqq/3687b809d83761db23bc437dc901c104 to your computer and use it in GitHub Desktop.
Input verification on front and back ends
<?php
protected function form()
{
$form = new Form(new ModelName);
$form->text('title')->rules('required')->required()->help('This field must be required');
$form->text('number')->rules('required|regex:/\d{3}/')->pattern('\d{3}')->help('This field must be three digits');
return $form;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment