Labour introduced a law to "put homegrown talent at the front of the queue" after a rise in foreign recruits over the last decade.