PHP code example of zodream / validate
1. Go to this page and download the library: Download zodream/validate library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zodream / validate example snippets
Validator::make([
'name' => 'ge' => '用户名必填']
[['name', 'url'], ''
])->validate($data); // bool
Validator::make([
'name' => 'name' => ['错误信息']]
$v->firstError(); // '错误信息'
class Do extends Model {
public function rules() {
return [
'name' => ' return [
' 'name' => '用户名'
];
}
}
app('request')->validate([
'name' => '
Validator::