When SATA hard drives and optical drives were introduced several years ago, the data and power connectors used were the same for both laptop and desktop drives (unlike the older IDE or P-ATA drives, thank goodness).
BUT - their form factors are different. A desktop drive is 3.5 inches/90 mm wide - a laptop or notebook drive is 2.5 inches/63.5 mm wide. That means you can put a laptop drive into a desktop, if you can mount it and are willing to accept the slightly lesser performance of a laptop drive (typical desktop hard drives spin at 7200 rpm, while typical laptop drives turn at 5400 rpm).
I have a customer's HP Slimline s7320n computer on my repair bench right now. This machine was manufactured to be a small desktop computer - it uses a laptop CPU (processor) so that there is less heat generated from the computer. The hard drive was removed from it by a previous owner (the drive was probably destroyed to eliminate any chance of data leakage).
My customer was willing to have a used laptop SATA drive installed that I had on hand, as long as I discounted the selling price to him a bit. But because of the nature of the machine, I'd need an adapter to mount the drive. This being a budget constrained repair, I made an adapter out of a soup can.
How did I make it? First, I cut the top and bottom out of a large soup can and then cut it apart - wearing gloves during its manufacture to protect my hands from cuts. Any steel can will work as long as it's wide enough and will be long enough once cut apart. Then I flattened the can by pounding it with a hammer while holding it against a backing item - a small block of wood works well. I then trimmed it to size - I chose to trim it such that the sharp cut edges were against the steel sides of the carrier. This lessens the chance of a future service person cutting themselves on the adapter if it has to be removed.
I positioned the nascent adapter in the carrier and placed the assembly over a piece of wood wide enough to fit in between the carrier's 'rails'. Then I put pressure on the assembly and drilled holes in the adapter, using the mounting holes in the carrier as a pilot.
I then took a piece of single sided adhesive paper I had and put it on the bottom om the laptop drive, lining up a good edge of the paper to the longest dimension of the drive. I used a pencil to shade over the mounting holes (similar to making a rubbing). I then trimmed the adhesive paper to the same size as the drive, peeled the backing off, lined up the mark showing the hole in its lower left corner with the drilled hole in the lower left of the nascent adapter (in the picture showing the 'underside' of the assembled drive, adapter, and carrier, this is the smaller screw in the lower left). I ensured everything was correctly aligned, and stuck the paper onto the proto-adapter.
Then I put the adapter on a block of wood again and drilled the two holes needed for the 'upper' side of the dive (seen in the hole that's in middle of the carrier. THIS IS VERY IMPORTANT: I then filed all sharp edges (including hole edges) to make them less sharp and to ensure there were no metal fragments remaining attached to the adapter. If a fragment breaks away from the adapter and happens to bridge traces on the motherboard, the computer may be damaged or destroyed. I wiped the adapter clean to ensure there wasn't any metal 'dust' on it.
I then assembled everything, put the carrier back in the computer, slide it partway in, attached the data and power connectors to the drive, slid the carrier 'home', and inserted and tightened the retaining screw. I then put the cover back on the computer and screwed in the attaching screws.
It works great, and my customer is happy that I saved him some money!