Sweep the doorway area with a broom so that it is free from dirt and other debris.
Set a piece of the foam underlayment next to one of the doorjambs. Place a plank of laminate flooring upside down on top of the underlayment. You will be cutting the doorjambs to fit the laminate flooring. Using the laminate flooring and underlayment as a template for this will make it possible for the laminate flooring to fit underneath the doorjambs.
Cut both doorjambs and the door casings to size with a dovetail saw. Stick a screwdriver behind the cut doorjambs to pull the pieces out. Vacuum the area and then test the laminate flooring to see if it will fit beneath each of the doorjambs.
Install the laminate flooring per manufacturer directions. When you get to the doorway, measure the area for each piece with a measuring tape. The laminate flooring should slide directly under the doorjambs, but there should be ¼ inch expansion gap between the wall and the flooring. Cut the laminate flooring to size on a table saw.