Skip to content

Instantly share code, notes, and snippets.

@cuongdcdev
Forked from jxlwqq/verification.php
Created July 28, 2019 18:02
Show Gist options
  • Save cuongdcdev/ccbbff0ec4b7414559de028683af7d11 to your computer and use it in GitHub Desktop.
Save cuongdcdev/ccbbff0ec4b7414559de028683af7d11 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