
Authentication
Laravel Breeze, guards, middleware auth, password hashing, remember me, email verification, password reset
1What is a guard in Laravel?
What is a guard in Laravel?
Answer
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.
2What is the main role of the 'auth' middleware in Laravel?
What is the main role of the 'auth' middleware in Laravel?
Answer
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.
3What is the difference between Hash::make() and bcrypt() in Laravel?
What is the difference between Hash::make() and bcrypt() in Laravel?
Answer
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.
What is the role of the 'remember_token' in Laravel?
What is Laravel Breeze?
+17 interview questions
Other Laravel interview topics
PHP Basics
PHP OOP Essentials
Composer & Autoloading
Laravel Fundamentals
Laravel Routing
Blade Templates
Request & Response
Eloquent ORM Basics
Eloquent Relationships
Migrations & Schema Builder
Validation & Forms
Authorization & Policies
API Resources & Authentication
Middleware
Service Container & DI
Queues & Jobs
Events & Listeners
Notifications & Mail
File Storage
Testing & PHPUnit
Caching
Livewire & Inertia
Eloquent Advanced
Repository Pattern
Laravel Packages
Performance Optimization
Security Best Practices
Laravel Octane
Laravel Distributed Systems
Observability & Monitoring
Deployment & DevOps
Master Laravel for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free