I am Looking for guidance on mounting a laser light in our daughter's office/room remodel to the ceiling, while providing a clean way to hide the power cable. Some of the laser light devices come with a detachable cable, others do not. Is it "up-to-code" to pass the power cable through the ceiling where it could connect with a 1-gang outlet box affixed to the attic rafter?
Here is an example I found that I might pass the power cable through...
Then I would connect the power cable to an outlet like this:
If there is a better recommendation, please share!