Yes! It will work mostly the same.
The only change you will need is to validate if the laser is hitting something.
If it is mostly instantaneous you can validate with the Raycast test.
If you want something more complex where the Laser is not instantaneous. You may need to calculate manually the “distance” of the ray.
You can do other things like heat up the laser too. Let me know I can give you more assistance in that way.