love.physics.newMouseJoint
Create a joint between a body and the mouse.

This joint actually connects the body to a fixed point in the world. To make it follow the mouse, the fixed point must be updated every timestep (example below).

The advantage of using a MouseJoint instead of just changing a body position directly is that collisions and reactions to other joints are handled by the physics engine.
joint = love.physics.newMouseJoint( body, x, y )
body Body The body to attach to the mouse.
x number The x position of the connecting point.
y number The y position of the connecting point.
joint MouseJoint The new mouse joint.