first try at docker

This commit is contained in:
j3d1 2019-12-17 01:33:40 +01:00
parent 6eecd02c5a
commit 08b1a62dc6
5 changed files with 58 additions and 0 deletions

View file

@ -37,17 +37,22 @@ class ItemController extends Controller
public function showOneItem($event, $id)
{
$eid = Event::where('slug','=',$event)->first()->eid;
return response()->json(Item::find($id));
}
public function create($event, Request $request)
{
$eid = Event::where('slug','=',$event)->first()->eid;
$data = $request->all();
$data['eid'] = $eid;
$item = Item::create($request->all());
return response()->json($item, 201);
}
public function update($event, $id, Request $request)
{
$eid = Event::where('slug','=',$event)->first()->eid;
$item = Item::findOrFail($id);
$item->update($request->all());
@ -56,6 +61,7 @@ class ItemController extends Controller
public function delete($event, $id)
{
$eid = Event::where('slug','=',$event)->first()->eid;
Item::findOrFail($id)->delete();
return response()->json(array("satus"=>'Deleted Successfully'), 200);
}