fix generation of item_uid

This commit is contained in:
Daniel Klamt 2019-12-22 22:07:48 +01:00
parent d2d0614640
commit 59c245232b

View file

@ -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');