Laravel is a PHP web framework used to build modern, secure, and scalable web applications. It follows the MVC architecture and provides features like routing, middleware, Eloquent ORM, authentication, queues, and caching. Laravel was created by Taylor Otwell. The first Laravel release was made in 2011, and it was designed to make PHP web development simpler, cleaner, and more productive.
1. MVC
Laravel follows MVC architecture: Model handles data, View handles UI, and Controller handles application logic and requests.
2. Routing
Routes define how Laravel responds to URLs and HTTP requests and connect requests to controllers or actions.
3. Middleware
Middleware filters HTTP requests before they reach the application, commonly used for authentication, authorization, and request checks.
4. Eloquent ORM
Eloquent is Laravel's ORM that allows you to interact with database tables using PHP models instead of writing SQL directly.
5. Migration
Migrations are used to create and modify database structures using PHP code and provide version control for the database schema.
6. Service Container
Laravel's Service Container manages and resolves class dependencies automatically. It is the foundation for Dependency Injection in Laravel.
7. Dependency Injection
Dependency Injection means providing a class with the objects it needs instead of creating those objects manually inside the class.
8. Facades
Facades provide a simple, static-looking interface to Laravel services managed by the Service Container, such as DB, Cache, and Log.
9. Repository Pattern
The Repository Pattern separates database/data-access logic from business logic, making the application easier to maintain and test.
10. Service Layer
A Service class contains business logic and keeps controllers focused mainly on handling requests and responses.
11. Jobs & Queues
Jobs represent tasks that can be processed by a queue worker in the background, such as sending emails or processing files.
12. Queue Retry
If a queued job fails, Laravel can retry that specific job based on configured attempts and delays. Permanently failed jobs can be stored in the failed jobs table.
13. Observer
An Observer listens to Eloquent model events such as created, updated, and deleted and performs related actions automatically.
14. Events & Listeners
Events represent something that happened in the application, while Listeners contain the actions that should happen in response to that event.
15. Authentication
Authentication verifies who the user is, usually through login, sessions, tokens, or other authentication mechanisms.
16. Authorization
Authorization determines what an authenticated user is allowed to do, commonly using Gates and Policies.
17. Policy
A Policy contains authorization rules for a specific model or resource, such as whether a user can update or delete a post.
18. Eager Loading
Eager Loading loads relationships in advance using methods like with() to reduce database queries and prevent the N+1 problem.
19. Database Transaction
A transaction groups multiple database operations so they either all succeed or all roll back if an operation fails.
20. Caching
Caching stores frequently used data temporarily so future requests can retrieve it faster without repeatedly querying the database.
21. Soft Delete
Soft Delete does not permanently remove a record. Laravel stores a deleted_at timestamp and excludes the record from normal queries.
22. API Resource
API Resources transform models into controlled JSON responses, allowing you to define exactly what data an API returns.
23. CSRF
CSRF protection prevents attackers from making authenticated users perform unwanted actions through forged requests.
24. Mass Assignment
Mass assignment protection controls which model fields can be assigned using methods such as create() or update().
25. Inertia.js
Inertia connects Laravel with frontend frameworks like React without requiring a traditional separate API for every page.
26. Inertia SSR
Server-Side Rendering allows React pages to be rendered into HTML on the server before being sent to the browser, improving initial rendering and SEO.
27. Sync vs Async
Synchronous execution waits for a task to finish, while asynchronous execution allows the main process to continue while the task is handled separately.
28. Artisan
Artisan is Laravel's command-line tool used for tasks such as creating files, running migrations, managing queues, and clearing caches.