L
Laravel interview questions
Laravel architecture, Eloquent ORM, routing, queues, and application design.
Topic
Laravel Fundamentals
1What is Laravel?2What are the main features of Laravel?3What are the advantages of using Laravel?4What is MVC architecture in Laravel?5What are the system requirements for Laravel 13?6What is the Laravel request lifecycle?7What is the Laravel directory structure?8What is Artisan in Laravel?9What is Composer, and why does Laravel use it?10What is the purpose of the .env file?
Topic
Routing and Controllers
1What is routing in Laravel?2What is the difference between routes/web.php and routes/api.php?3What are named routes?4What are route parameters?5What are optional route parameters?6What is route model binding?7What is the difference between implicit and explicit route model binding?8What are route groups?9What is a resource controller?10What is a single-action or invokable controller?
Topic
Middleware, Requests and Validation
1What is middleware in Laravel?2How do you create custom middleware?3What is the difference between global and route middleware?4How do you retrieve request data in Laravel?5What is dependency injection in a controller method?6How does Laravel validation work?7What is a Form Request?8How do you create a custom validation rule?9What is the difference between validated() and safe()?10How do you customize Laravel validation error messages?
Topic
Blade, Views and Frontend
1What is the Blade template engine?2What is the difference between {{ }} and {!! !!}?3How does Blade prevent cross-site scripting?4What are Blade layouts and sections?5What are Blade components?6What is the difference between anonymous and class-based components?7What are Blade directives?8How do you create a custom Blade directive?9What are view composers?10What are Laravel Vite, Livewire and Inertia?
Topic
Database and Migrations
1What is a migration in Laravel?2How do you create and run migrations?3What is the difference between migrate:rollback, migrate:reset, and migrate:fresh?4What are seeders and factories?5How do database transactions work in Laravel?6How do you use multiple database connections?7What is the Laravel Query Builder?8What is the difference between Query Builder and Eloquent?9How do you identify and optimize slow database queries?10How do you prevent SQL injection in Laravel?
Topic
Eloquent ORM
1What is Eloquent ORM?2What are $fillable and $guarded?3What are accessors and mutators?4What is attribute casting?5What are local and global query scopes?6What is the difference between find(), first(), firstOrFail(), and findOrFail()?7What is the difference between get(), first(), value(), and pluck()?8What are soft deletes?9What are model events and observers?
Topic
Eloquent Relationships and Collections
1What relationship types are available in Eloquent?2What is a one-to-one relationship?3What is a one-to-many relationship?4What is a many-to-many relationship?5What are polymorphic relationships?6What is the difference between eager loading and lazy loading?7What is the difference between with(), load(), and loadMissing()?8What are Eloquent API resources?9What is the difference between a Laravel collection and an Eloquent collection?
Topic
Service Container and Architecture
1What is the Laravel service container?2What are service providers?3What is the difference between the register() and boot() methods?4What are facades in Laravel?5How are facades different from dependency injection?6What are contracts or interfaces in Laravel?7What is the repository pattern, and should every Laravel application use it?8What are events and listeners?9What is the difference between events, listeners, observers, and subscribers?
Topic
Authentication, Authorization and Security
1What is the difference between authentication and authorization?2What are guards and providers?3What are gates and policies?4What is Laravel Sanctum?5What is the difference between Laravel Sanctum and Passport?6How does CSRF protection work in Laravel?7How does Laravel prevent SQL injection and XSS attacks?8How should passwords be hashed and verified?9What is rate limiting, and how is it implemented?10How do signed and temporary signed URLs work?
Topic
Queues, APIs, Testing and Performance
1What are jobs and queues in Laravel?2How do failed jobs, retries, timeouts, and backoff work?3What is the difference between job batching and job chaining?4What are Laravel Horizon, Octane, Reverb and Pulse?5How do you build and authenticate a REST API?6What is the difference between unit, feature, and browser testing?7How do you test databases, queues, events, notifications, and HTTP requests?8How do caching and Redis improve Laravel performance?9Which commands should be used to optimize a Laravel application for production?10What are the important features introduced in Laravel 13?