Laravel 3.2 Documentation................................................................................ 55 Validation Rules ................................................................................................. ......................................................................... 63 Custom Validation Rules .............................................................................................. 64 have created indexes on tables using the Laravel migration system and you used to the default index naming scheme provided by Laravel, prefix the index names with their table name on your database. So, if0 码力 | 139 页 | 1.13 MB | 1 年前3
Learning Laravel133 Using DB query builder 134 Using Eloquent 134 From Laravel Documentation 134 Chapter 43: Naming Files when uploading with Laravel on Windows 136 Parameters 136 Examples 136 Generating timestamped Customising error messages within a Request class 193 Displaying error messages 193 Custom Validation Rules 194 Credits 196 About You can share this PDF with anyone you feel could benefit from it, downloaded corresponds to the name of the variable we want to pass to the view. view('example', compact('name')); NAMING CONVENTION FOR BLADE VARIABLES While sending data back to view. You can use underscore for multi-words0 码力 | 216 页 | 1.58 MB | 1 年前3
Laravel 5.0 Documentation
v. Error Messages & Views vi. Available Validation Rules vii. Conditionally Adding Rules viii. Custom Error Messages ix. Custom Validation Rules 7. Database i. Basic Usage i. Configuration ii. php namespace App\Http\Requests; class RegisterRequest extends FormRequest { public function rules() { return [ 'email' => 'required|email|unique:users', 'password' action is called, you can safely assume the HTTP request input has been validated according to the rules you specified in your form request class. Even more, if the request is invalid, an HTTP redirect0 码力 | 242 页 | 1.44 MB | 1 年前3
The Laravel Handbook
corresponding table, which we do not mention, but it’s the dogs table we created beforehand because of the naming convention dogs table → Dog model. We’re going to use this model to add an entry to the database0 码力 | 111 页 | 14.25 MB | 1 年前3
Laravel 5.6 中文文档求处理做好 准备工作。 在新安装的 Laravel 应用中,该目录已经包含了一些服务提供者,你可以按需添加自己的服务提供者到该目录。 Rules 目录 该目录默认不存在,但是会伴随你执行 Artisan 命令 make:rule 自动生成。Rules 目录包含应用的自定义验证规则对象,这些规则用于在单个对象 中封装复杂的验证逻辑,想要了解更多的话,请参考验证文档。 Homestead 目录下,如果该目录不存在,运行 make:request 命令时会替我们生成。接下来我们添加少许验证规则到该类 的 rules 方法: /** * 获取应用到请求的验证规则 * * @return array */ public function rules(){ return [ 'title' => 'required|unique:posts|max:255' 'required' => 'The :attribute field is required.', ]; $validator = Validator::make($input, $rules, $messages); 在本例中,:attribute 占位符将会被验证时实际的字段名替换,你还可以在验证消息中使用其他占位符,例如: $messages = [ 'same'0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 6.0 中文文档求处理做好准备工作。 在新安装的 Laravel 应用中,该目录已经包含了一些服务提供者, 你可以按需添加自己的服务提供者到该目录。 Rules 目录 该目录默认不存在,但是会伴随你执行 Artisan 命令 make:rule 自 动生成。Rules 目录包含应用的自定义验证规则对象,这些规则用于 在单个对象中封装复杂的验证逻辑,想要了解更多的话,请参考验证 文档。 重 量 级 开 目录下,如果该目录不存在,运 行 make:request 命令时会替我们生成。接下来我们添加少许验证规 则到该类的 rules 方法: /** * 获取应用到请求的验证规则 * * @return array */ public function rules(){ return [ 'title' => 'required|unique:posts|max:255', 本文档由学院君提供 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 325 'body' => 'required', ]; } 注:你可以在 rules 方法签名签名中注入任何依赖,它 们会通过服务容器自动解析。 那么,验证规则如何生效呢?你所要做的就是在控制器方法中类型提 示该请求类。这样表单输入请求会在控制器方法被调用之前被验证, 这0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.2 中文文档StoreBlogPostRequest 生成的类位于 app/Http/Requests 目录下,接下来我们添加少许验证规则到 rules 方法: /** * 获取应用到请求的验证规则 * * @return array */ public function rules(){ return [ 'title' => 'required|unique:posts|max:255' 方法自定义表单请求使用的错误消息,该方法应该返回属性/规 则对数组及其对应错误消息: /** * Get the error messages for the defined validation rules. * * @return array */ public function messages(){ return [ 'title.required' => 'required' => 'The :attribute field is required.', ]; $validator = Validator::make($input, $rules, $messages); 在本例中,:attribute 占位符将会被验证时实际的字段名替换,你还可以在验证消息中使 用其他占位符,例如: $messages = [ 'same'0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 5.3 中文文档StoreBlogPost 生成的类位于 app/Http/Requests 目录下,接下来我们添加少许验证规则到 rules 方法: /** * 获取应用到请求的验证规则 * * @return array */ public function rules(){ return [ 'title' => 'required|unique:posts|max:255' 方法自定义表单请求使用的错误消息,该方法应该返回属性/规则对数 组及其对应错误消息: /** * Get the error messages for the defined validation rules. * * @return array */ 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 'required' => 'The :attribute field is required.', ]; $validator = Validator::make($input, $rules, $messages); 在本例中,:attribute 占位符将会被验证时实际的字段名替换,你还可以在验证消息中使用其他 占位符,例如: $messages = [ 'same'0 码力 | 691 页 | 9.37 MB | 1 年前3
《Slides Dev Web》 12. Risques applicatifs
paramètres (même si redondant) : 20https://nakedsecurity.sophos.com/2016/08/18/nists-new-password-rules-what-you-need-to-know/ 21https://www.ncsc.gov.uk/guidance/password-guidance-simplifying-your-approach0 码力 | 12 页 | 474.37 KB | 1 年前3
Laravel 5.1 中文文档StoreBlogPostRequest 生成的类位于 app/Http/Requests 目录下,接下来我们添加少许验证规则到 rules 方法: /** * 获取应用到请求的验证规则 * * @return array */ public function rules(){ return [ 'title' => 'required|unique:posts|max:255' 'required' => 'The :attribute field is required.', ]; $validator = Validator::make($input, $rules, $messages); 在本例中,:attribute 占位符将会被验证时实际的字段名替换,你还可以在验证消息中使 用其他占位符,例如: $messages = [ 'same'0 码力 | 307 页 | 3.46 MB | 1 年前3
共 10 条
- 1













