diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index 8051802..52e8f6b 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -46,9 +46,10 @@ class ItemController extends Controller public function create($event, Request $request) { $eid = Event::where('slug','=',$event)->first()->eid; + $uid = Item::where('eid',$eid)->max('item_uid') + 1; $newitem = $request->except(['dataImage']); $newitem['eid'] = "".$eid; - $newitem['item_uid'] = "".rand(10, 100); + $newitem['item_uid'] = $uid; $newitem['wo'] = ""; $item = Item::create($newitem); $dataImage = $request->get('dataImage');