@someoneingermany
Usually your work contract contains a paragraph about the period of notice. If not, there is a statutory period of notice that is 4 weeks (28 days) (in accordance with ยง622 BGB). This applies to all employees and not just Germans or asylum seekers. So if your employer gave you notice on time, it is lawful for him to lay you off this way, as far as I can see.
Best regards,
Thorgen