Your laptop smells like you. So your cat associates the smell with comfort. Plus it is warm. Start storing your laptop in a laptop carrying bag. You can set most laptops to sleep mode which it will do anyway when the lid is closed. If you must leave it up and running, place it under a cardboard box. That way the laptop can continue to work and the cat can sit or sleep on top of the box.
I don't suggest ever spraying a cat with water. Doing so will make the cat associate water with punishment and you will have difficulty bathing him or her if you need to give her a bath. I have found much better luck with the carrot rather than the stick method of training all types of animals. Give your beloved pet a treat when it gives you a desired behavior. Then it will want to do more things you like to get the treat. It can be a teeny tiny treat. It does NOT need to be a whole T-bone steak. I have found pounce brand of treats works well with training cats.
You might try making a kitty bed out of an old bedroom pillow. Make a cute sham that has a cat theme, put it inside a cardboard box that has been cut down and is easy to get into. Then place a few of your kitty's favorite toys inside and a pounce in the center. That way the kitty views the bed a place to be treated and pampered. Place that bed in the box on top of the carton covering your computer. After the cat starts sleeping there. Remove your laptop and store it else where. Once your cat has built a habit of sleeping in its own bed, try leaving your laptop out. And see if it goes back to sleeping on your laptop. If it goes right back to your computer, you may need to keep it stored else where for good at night.
I hope this helps. Some cats can be very stubborn when it concerns behavior modification, especially if it is a long term habit.
I hope this helps.
Many years of raising cats that are well behaved and enjoyable to live with.