From 9f172b9c0b71599d70e8c206c157065d2602a43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 29 Aug 2022 17:17:38 +0300 Subject: [PATCH] Document item table quantity column length changes.. --- app/Http/Requests/Document/Document.php | 4 +-- app/Http/Requests/Document/DocumentItem.php | 4 +-- .../2022_08_29_000000_core_v307.php | 36 +++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 database/migrations/2022_08_29_000000_core_v307.php diff --git a/app/Http/Requests/Document/Document.php b/app/Http/Requests/Document/Document.php index 0fe321147a..bc39ca7615 100644 --- a/app/Http/Requests/Document/Document.php +++ b/app/Http/Requests/Document/Document.php @@ -69,10 +69,10 @@ public function rules() if ($items) { foreach ($items as $key => $item) { - $size = 5; + $size = 10; if (Str::contains($item['quantity'], ['.', ','])) { - $size = 7; + $size = 12; } $rules['items.' . $key . '.quantity'] = 'required|max:' . $size; diff --git a/app/Http/Requests/Document/DocumentItem.php b/app/Http/Requests/Document/DocumentItem.php index 26565d3ef1..f6975b1b97 100644 --- a/app/Http/Requests/Document/DocumentItem.php +++ b/app/Http/Requests/Document/DocumentItem.php @@ -7,7 +7,7 @@ class DocumentItem extends FormRequest { - protected $quantity_size = 5; + protected $quantity_size = 10; /** * Get the validation rules that apply to the request. @@ -17,7 +17,7 @@ class DocumentItem extends FormRequest public function rules() { if (Str::contains($this->request->get('quantity'), ['.', ','])) { - $this->quantity_size = 7; + $this->quantity_size = 12; } return [ diff --git a/database/migrations/2022_08_29_000000_core_v307.php b/database/migrations/2022_08_29_000000_core_v307.php new file mode 100644 index 0000000000..881befe6ac --- /dev/null +++ b/database/migrations/2022_08_29_000000_core_v307.php @@ -0,0 +1,36 @@ +double('quantity', 12, 2)->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +};