Laravel

Authentication

Laravel Breeze, guards, middleware auth, password hashing, remember me, email verification, password reset

20 питань зі співбесід·
Mid-Level
1

What is a guard in Laravel?

Відповідь

A guard defines the authentication mechanism used to verify user identity. Laravel provides by default the 'web' guard for sessions and 'api' guard for tokens. Guards allow managing different authentication types simultaneously and configuring how users are authenticated in each request.

2

What is the main role of the 'auth' middleware in Laravel?

Відповідь

The 'auth' middleware verifies that the current user is authenticated before accessing a route. If the user is not authenticated, they are redirected to the login page. This middleware is essential to protect routes requiring authentication and ensure only logged-in users access them.

3

What is the difference between Hash::make() and bcrypt() in Laravel?

Відповідь

Hash::make() is Laravel's recommended abstraction for hashing passwords, while bcrypt() is a specific function. Hash::make() uses bcrypt by default but allows changing the hashing algorithm in configuration (argon2id, bcrypt). Using Hash::make() is considered best practice as it offers more flexibility and control over the hashing mechanism.

4

What is the role of the 'remember_token' in Laravel?

5

What is Laravel Breeze?

+17 питань зі співбесід

Опануй Laravel для наступної співбесіди

Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.

Почни безкоштовно