1 | <?php namespace VojtaSvoboda\Reservations\Validators; |
||
15 | class ReservationsValidators extends Validator |
||
16 | { |
||
17 | /** |
||
18 | * Validate reservation. Called on date attribute. Validate date availability. |
||
19 | * |
||
20 | * Other available variables: $this->translator, $this->data, $this->rules a $this->messages. |
||
21 | * |
||
22 | * @param string $attribute Name of the validated field. |
||
23 | * @param mixed $value Field value. |
||
24 | * |
||
25 | * @return bool |
||
26 | */ |
||
27 | public function validateReservation($attribute, $value) |
||
35 | |||
36 | /** |
||
37 | * Validate date attribute. |
||
38 | * |
||
39 | * @param string $value |
||
40 | * |
||
41 | * @return bool |
||
42 | */ |
||
43 | protected function validateDateAttribute($value) |
||
58 | |||
59 | /** |
||
60 | * Replace placeholder :reservation with custom text. |
||
61 | * |
||
62 | * @param string $message |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | protected function replaceReservation($message) |
||
72 | |||
73 | /** |
||
74 | * Returns if reservation is cancelled or going to be cancelled. |
||
75 | * |
||
76 | * @param Reservation $reservation |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | private function isReservationCancelled($reservation) |
||
86 | |||
87 | /** |
||
88 | * Get date as Carbon instance. |
||
89 | * |
||
90 | * @param string $date |
||
91 | * |
||
92 | * @return Carbon |
||
93 | */ |
||
94 | private function getDateAsCarbon($date) |
||
98 | |||
99 | /** |
||
100 | * Get Reservations facade. |
||
101 | * |
||
102 | * @return ReservationsFacade |
||
103 | */ |
||
104 | private function getFacade() |
||
108 | } |
||
109 |