Last active
November 3, 2022 04:11
-
-
Save jxlwqq/3687b809d83761db23bc437dc901c104 to your computer and use it in GitHub Desktop.
Input verification on front and back ends
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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