Skip to content

Commit 2746388

Browse files
committed
Update: product size validation and message
1 parent 93e70fa commit 2746388

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Http/Livewire/Admin/Attribute/Create.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ public function saveAttribute()
4242
$this->message = '';
4343

4444
$this->validate([
45-
'size' => 'required|string|min:1|max:3',
45+
'size' => 'required|string|min:1|max:3|in:XS,S,M,L,XL,2XL,3XL',
4646
'price' => 'required|int',
4747
'quantity' => 'required|int',
48+
], [
49+
'size.in' => 'The selected size must be one of these, XS,S,M,L,XL,2XL,3XL'
4850
]);
4951

5052
//Create Attr

0 commit comments

Comments
 (0)