You can use a line-generating lens for this. Building an entire laser projector just to get a straight line is overkill. If you still want to know more about laser projectors, read through the sticky thread in the laser shows section. If you still have questions, start a thread there.
Yes, you can just use a line lens, or also just a little cylinder of glass or plexiglass in front of the beam, for generate it, or simply buy a line generator module, like the ones from o-like site .....
plastic line lenses are available a bit anywhere, like this one, that fit the focus ring of an aixiz module (the flat surface go outside)
If instead you don't find them, but have a little cylinder of glass or plexiglass, you can do the same just putting it in front of the beam