Total Complexity | 3 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class MatchOldPassword implements Rule |
||
9 | { |
||
10 | /** |
||
11 | * Create a new rule instance. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | public function __construct() |
||
16 | { |
||
17 | // |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * Determine if the validation rule passes. |
||
22 | * |
||
23 | * @param string $attribute |
||
24 | * @param mixed $value |
||
25 | * @return bool |
||
26 | */ |
||
27 | public function passes($attribute, $value) |
||
28 | { |
||
29 | return Hash::check($value, auth()->user()->password); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Get the validation error message. |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | public function message() |
||
40 | } |
||
41 | } |
||
42 |