map(function ($p) { return [ 'Id' => $p->id, 'UserName' => $p->username, 'Name' => $p->name, ]; }); return response()->json($profiles); } /** * Get a user * * Returns a JSON array of all the smartdok users registered on the system * * @param $id * * Example response: * { * "Id": "00000000-0000-0000-0000-000000000000", * "UserName": "string", * "Name": "string" * } */ public function show(string $id) { $p = SmartdokProfile::findOrFail($id); return response()->json([ 'Id' => $p->id, 'UserName' => $p->username, 'Name' => $p->name, ]); } }