1@if($errors->any())
2 <div class="alert alert-danger">
3 <p><strong>Opps Something went wrong</strong></p>
4 <ul>
5 @foreach ($errors->all() as $error)
6 <li>{{ $error }}</li>
7 @endforeach
8 </ul>
9 </div>
10@endif
11
12@if(session('success'))
13 <div class="alert alert-success">{{session('success')}}</div>
14@endif
15
16@if(session('error'))
17 <div class="alert alert-danger">{{session('error')}}</div>
18@endif
19
1@if($errors->has())
2 @foreach ($errors->all() as $error)
3 <div>{{ $error }}</div>
4 @endforeach
5@endif
1 @if ($errors->any())
2 @foreach ($errors->all() as $error)
3 <div>{{$error}}</div>
4 @endforeach
5 @endif
6
1public function testAjax(Request $request)
2 {
3 $name = $request->input('name');
4 $validator = Validator::make($request->all(), ['name' => 'required']);
5
6 if ($validator->fails()){
7 $errors = $validator->errors();
8 echo $errors;
9 }
10 else{
11 echo "welcome ". $name;
12 }
13
14 }
15
1if (request('event') == null) {
2 $validator->errors()->add('event', 'Please select an event');
3}
1@if($errors->any())
2 @foreach ($errors->all() as $error)
3 <div>{{ $error }}</div>
4 @endforeach
5@endif