[英]Laravel validation with Bootstrap Modal
I've included this Github script to make a validation form with Bootstrap Modal everything is set up correctly but when I included this script the form don't submit because there are some errors which is good but it doesn't show them in the view 我已经包含了这个Github 脚本 ,以便使用Bootstrap Modal制作一个验证表单,但一切都已正确设置,但是当我包含此脚本时,该表单不会提交,因为有些错误很好,但它不会在视图中显示
Controller 控制者
$this->validate($request, [
'nom' => 'required|unique:filieres'
]);
View 视图
@if($errors->get('nom'))
@foreach($errors->get('nom') as $error)
<li class="has-error">{{$error}}</li>
@endforeach
@endif
can you just type this code in your view file 您可以在视图文件中键入此代码吗
@include('includes.form_error')
second type this in your controller 在您的控制器中第二次输入
public function store(UsersRequest $request)
{
}
and you create UserRequest file in Requests folder and type this 然后在“请求”文件夹中创建UserRequest文件,然后键入
public function rules()
{
return [
'name' => 'required',
];
}
after you got proper error 得到正确的错误后
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.