The US president has repeatedly taken actions to limit immigration after violent attacks, blaming foreigners for crime.