Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- Simple, fast routing engine.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, powerful, and provides tools required for large, robust applications.
Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.
If you don't feel like reading, Laracasts can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Partners program.
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.
The Laravel framework is open-sourced software licensed under the MIT license.
This project extends Laravel with a feature-based modular architecture using nWidart/laravel-modules for building scalable applications.
- Feature-Based Modules: Each module contains everything related to a specific feature (like NestJS)
- Clean Architecture: Separation of concerns with Controllers, Services, Models, Requests, etc.
- Auto-Discovery: Modules are automatically discovered and registered
- Independent Development: Teams can work on modules independently
- Microservice Ready: Easy to extract modules into separate services later
- Comprehensive CLI: Rich set of Artisan commands for module management
Each module follows this organized structure:
Modules/
├── Auth/
│ ├── app/
│ │ ├── Http/
│ │ │ ├── Controllers/AuthController.php
│ │ │ └── Requests/
│ │ │ ├── LoginRequest.php
│ │ │ └── RegisterRequest.php
│ │ ├── Models/User.php
│ │ ├── Services/AuthService.php
│ │ ├── Transformers/UserResource.php
│ │ └── Providers/
│ ├── routes/
│ │ ├── api.php
│ │ └── web.php
│ ├── database/migrations/
│ ├── tests/
│ └── module.json
│
└── Product/
└── [same structure...]
php artisan module:make ModuleName# Create components for your module
php artisan module:make-model ModelName ModuleName
php artisan module:make-controller ControllerName ModuleName
php artisan module:make-service ServiceName ModuleName
php artisan module:make-request RequestName ModuleName
php artisan module:make-migration create_table_name ModuleName# List all modules
php artisan module:list
# Enable/Disable modules
php artisan module:enable ModuleName
php artisan module:disable ModuleName
# Run module migrations
php artisan module:migrate ModuleName- Purpose: User authentication and management
- API Routes:
POST /api/v1/auth/loginPOST /api/v1/auth/registerPOST /api/v1/auth/logout(protected)GET /api/v1/auth/profile(protected)
- Features: JWT authentication with Laravel Sanctum
- Purpose: Product management
- API Routes:
GET /api/v1/products- List all productsPOST /api/v1/products- Create new productGET /api/v1/products/{id}- Get specific productPUT /api/v1/products/{id}- Update productDELETE /api/v1/products/{id}- Delete product
Everything related to one feature lives in one place:
- Controllers handle HTTP requests
- Services contain business logic
- Models define data structure
- Requests validate input
- Resources format API responses
// Example: AuthController with dependency injection
class AuthController extends Controller
{
public function __construct(
private AuthService $authService
) {}
public function login(LoginRequest $request): JsonResponse
{
$user = $this->authService->login($request->validated());
return response()->json([
'user' => new UserResource($user)
]);
}
}- Team A works on Auth module
- Team B works on Product module
- No conflicts or cross-dependencies
# Create business-specific modules
php artisan module:make OrderManagement
php artisan module:make PaymentProcessing
php artisan module:make Notification
php artisan module:make Analytics# Add more components to existing modules
php artisan module:make-middleware AuthMiddleware Auth
php artisan module:make-job SendWelcomeEmail Auth
php artisan module:make-event UserRegistered AuthThis template includes Laravel Sanctum for API authentication:
# Sanctum is already installed and configured
# To test authentication, use the provided auth endpointsRun php artisan list module to see all 40+ available commands:
module:make- Create new modulemodule:make-*- Generate components (model, controller, service, etc.)module:migrate- Run module migrationsmodule:seed- Run module seedersmodule:enable/disable- Control module status
- Keep modules focused - One module per business domain
- Use services for business logic - Keep controllers thin
- Validate with requests - Create specific request classes
- Format with resources - Use API resources for consistent output
- Test independently - Each module should have its own tests
When ready to scale to microservices:
- Each module is already self-contained
- Database migrations are separated
- API routes are modular
- Dependencies are clearly defined
This modular architecture provides a solid foundation for building scalable Laravel applications with clean, maintainable, and feature-focused code structure. 🚀