select only useful columns

This commit is contained in:
j3d1 2019-12-05 13:09:25 +01:00
parent 7e05999e64
commit 3758ff05cd

View file

@ -18,8 +18,9 @@ class ItemController extends Controller
{ {
$eid = Event::where('slug','=',$event)->first()->eid; $eid = Event::where('slug','=',$event)->first()->eid;
return response()->json(Item::where('eid','=',$eid) return response()->json(Item::where('eid','=',$eid)
->join('containers','items.cid','=','container.cid') ->join('containers','items.cid','=','containers.cid')
->leftJoin('files','items.iid','=','files.iid') ->leftJoin('files','items.iid','=','files.iid')
->select('items.*','files.hash as file', 'containers.name as container')
->get()); ->get());
} }