Skip to content

Commit

Permalink
add validation on requests
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvbhattt committed Aug 25, 2023
1 parent dbd75bb commit f11437c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/Http/Requests/EstimatesRequest.php
Expand Up @@ -45,15 +45,22 @@ public function rules()
'nullable'
],
'discount' => [
'numeric',
'required',
],
'discount_val' => [
'integer',
'required',
],
'sub_total' => [
'integer',
'required',
],
'total' => [
'integer',
'numeric',
'min:50',
'max:99999999',
'required',
],
'tax' => [
Expand All @@ -77,9 +84,11 @@ public function rules()
'required',
],
'items.*.quantity' => [
'integer',
'required',
],
'items.*.price' => [
'integer',
'required',
],
];
Expand Down
9 changes: 9 additions & 0 deletions app/Http/Requests/InvoicesRequest.php
Expand Up @@ -45,15 +45,22 @@ public function rules()
'nullable'
],
'discount' => [
'numeric',
'required',
],
'discount_val' => [
'integer',
'required',
],
'sub_total' => [
'integer',
'required',
],
'total' => [
'integer',
'numeric',
'min:50',
'max:99999999',
'required',
],
'tax' => [
Expand All @@ -77,9 +84,11 @@ public function rules()
'required',
],
'items.*.quantity' => [
'integer',
'required',
],
'items.*.price' => [
'integer',
'required',
],
];
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Requests/RecurringInvoiceRequest.php
Expand Up @@ -43,15 +43,22 @@ public function rules()
'nullable'
],
'discount' => [
'numeric',
'required',
],
'discount_val' => [
'integer',
'required',
],
'sub_total' => [
'integer',
'required',
],
'total' => [
'integer',
'numeric',
'min:50',
'max:99999999',
'required',
],
'tax' => [
Expand Down

0 comments on commit f11437c

Please sign in to comment.