1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<?php
namespace Illuminate\Validation;
use Exception;
class ValidationException extends Exception { /** * The validator instance. * * @var \Illuminate\Contracts\Validation\Validator */ public $validator;
/** * The recommended response to send to the client. * * @var \Symfony\Component\HttpFoundation\Response|null */ public $response;
/** * Create a new exception instance. * * @param \Illuminate\Contracts\Validation\Validator $validator * @param \Symfony\Component\HttpFoundation\Response $response * @return void */ public function __construct($validator, $response = null) { parent::__construct('The given data failed to pass validation.');
$this->response = $response; $this->validator = $validator; }
/** * Get the underlying response instance. * * @return \Symfony\Component\HttpFoundation\Response|null */ public function getResponse() { return $this->response; } }
|