public function info($device_id) { $header = app('request')->header(); if (!$this->check($header)) { return response('Unauthorized', 401); } $device = Device::with('local')->find($device_id); $mappings = Mapping::with(array('type', 'standard'))->where('device_id', '=', $device_id)->get(); $device->mappings = $mappings; return $device; }