You are confusing between friends at work and the employer itself. Layoffs are irrelevant: your friends (including those at work) will support you if you are laid off, unlike your employer.
Also, once you make a friend at work you can meet outside the workplace, or communicate with non-work communication channels.