The sum,S, of the internal angles of regular polygon is (n-2) 180°
Where n is the number of sides.
For the octagon n = 8, then S (8 - 2) 180° = 1080°.
Given that it is regular, each angle is 1080° / 8 = 135°
Then 4x + 12 = 135 => 4x = 135 - 12 = 123
x = 123 / 4 = 30.75 °