Skip to content

Commit

Permalink
Add new HTML validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier-hurtado-web committed Apr 14, 2018
1 parent 188b366 commit 88a860d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
13 changes: 7 additions & 6 deletions app/Http/Controllers/ReservationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ public function getSearchFields()
return $data->date_start;
},
'type' => 'date',
/*'optional' => [
'optional' => [
'required' => 'required',
],*/
],
],
[
'id' => 'date_end',
Expand All @@ -281,9 +281,9 @@ public function getSearchFields()
return $data->date_end;
},
'type' => 'date',
/*'optional' => [
'optional' => [
'required' => 'required',
],*/
],
],
[
'id' => 'people',
Expand All @@ -293,9 +293,10 @@ public function getSearchFields()
return 1;
},
'type' => 'number',
/*'optional' => [
'optional' => [
'required' => 'required',
],*/
'min' => '1',
],
],
];
}
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Controllers/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public function getFields()
'type' => 'number',
'optional' => [
'required' => 'required',
'min' => '1',
],
],
[
Expand All @@ -148,6 +149,8 @@ public function getFields()
},
'type' => 'number',
'optional' => [
'required' => 'required',
'min' => '0',
'step' => '0.01',
'placeholder' => '0.00',
],
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Requests/RoomRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public function rules()
'number' => 'required',
'floor' => 'required|numeric',
'capacity' => 'required|numeric|min:1|digits_between:1,2',
// TODO: regex?
'price' => 'required|numeric',
'price' => 'required|numeric|min:0',
'comment' => 'nullable',
];
}
Expand Down

0 comments on commit 88a860d

Please sign in to comment.