Download the PHP package webmonks/laravel-api-modules without Composer
On this page you can find all versions of the php package webmonks/laravel-api-modules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-api-modules
๐ Laravel API Modules
A powerful SOLID-principle Laravel modular code generator specifically designed for API-first projects.
Transform your Laravel development with intelligent module generation that creates clean, maintainable, and scalable API architectures following industry best practices.
โจ Why Laravel API Modules?
๐ฏ Built for API Excellence
- Zero Frontend Concerns: Pure API-focused architecture
- SOLID Principles: Every generated component follows dependency injection and single responsibility
- Repository Pattern: Clean separation of data access logic
- Service Layer: Business logic abstraction for better testability
โก Intelligent Generation
- Complete Module Scaffold: Controllers, Models, Services, Repositories, Interfaces, Requests, Migrations, Tests
- Two Generation Modes: Simple list APIs or full CRUD resources
- Auto-Wired Dependencies: Everything is pre-configured and ready to use
- Smart Naming: Consistent naming conventions across all components
๐ง Developer Experience
- One Command Setup: Generate complete modules with a single artisan command
- Zero Configuration: Works out of the box with sensible defaults
- Full Customization: Publish and modify all templates to match your standards
- IDE Friendly: Proper type hints and interfaces for better development experience
๐ฆ Installation
Requirements
| Component | Version |
|---|---|
| PHP | ^7.4 | ^8.0 | ^8.1 | ^8.2 | ^8.3 |
| Laravel | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0 |
Quick Install
Configuration (Optional)
That's it! The package is auto-discovered and ready to use. ๐
๐ Quick Start
Generate Your First Module
Remove Modules Safely
What Gets Generated?
Simple Module (php artisan make:module Blog)
Resource Module (php artisan make:module Product --resource)
Your Project Structure
After generating your first module, your Laravel application will have this enhanced structure:
๐ง Core Features
๐๏ธ Safe Module Removal
Complete cleanup with safety checks! The package provides:
- ๐ Preview Mode: See exactly what files will be removed before deletion
- ๐ฆ Automatic Backup: Creates timestamped backups before removal (optional)
- โ ๏ธ Multi-stage Confirmations: Multiple safety prompts prevent accidental deletion
- ๐งน Complete Cleanup: Removes all related files (controllers, models, tests, migrations, interfaces)
- ๐ Repository Binding Cleanup: Automatically cleans up service provider bindings
- ๐จ Security Validation: Prevents path traversal and validates module names
๐ Automatic Repository Binding
Zero Configuration Required! The package automatically:
- Generates
RepositoryServiceProvider.phpto bind interfaces to implementations - Registers the provider in Laravel's service container
- Creates proper dependency injection for all your modules
๐ท๏ธ Smart Traits System
The package includes battle-tested traits for common API functionality:
| Trait | Purpose | Auto-Included |
|---|---|---|
ApiResponser |
Consistent API response format | โ Required |
ActivityLogHelper |
Track model changes and actions | โ๏ธ Optional |
PdfGeneratorTrait |
Generate PDFs from Blade templates | โ๏ธ Optional |
SmsSender |
Send SMS via Twilio with logging | โ๏ธ Optional |
UserUpdater |
Auto-manage created_by, updated_by fields |
โ๏ธ Optional |
๐ Helper Autoloader
Drop any PHP helper files into app/Helpers/AutoloadFiles/ and they're automatically available throughout your application:
โ๏ธ Configuration
The package works perfectly with zero configuration, but offers extensive customization options:
๐ View Configuration Options
๐ก Usage Examples
Example 1: Blog API Module
Generated controller will have a clean, testable structure:
Example 2: Full CRUD Product API
This creates a full API with endpoints:
GET /api/products- List products with filteringGET /api/products/{id}- Get single productPOST /api/products- Create new productPUT /api/products/{id}- Update productDELETE /api/products/{id}- Delete product
Example 3: Custom Helper Integration
๐ง Advanced Customization
Custom Stub Templates
Publish stubs and modify them to match your team's conventions:
Edit any stub in stubs/laravel-api-modules/ to customize generated code:
Extending Base Classes
The generated BaseModel and BaseService can be extended with your common functionality:
๐งช Testing
The package generates comprehensive test files for each module:
Run tests for your modules:
๐ Documentation
Complete Guides
- ๐ Directory Structure Deep Dive - Understand the generated architecture
- ๐ง Helper System Guide - Master the auto-loader and create custom helpers
- ๐ท๏ธ Traits Reference - Leverage built-in traits and create your own
- โ๏ธ Configuration Reference - Customize every aspect of generation
- ๐ Migration Guide - Upgrade between versions smoothly
Resources
- ๐ Changelog - Track all changes and improvements
- ๐ค Contributing Guidelines - Join our development community
- ๐ Security Policy - Report security vulnerabilities
- โ๏ธ Code of Conduct - Community standards
๐ค Contributing
We welcome contributions from the community! Whether it's:
- ๐ Bug Reports: Found an issue? Let us know!
- ๐ก Feature Requests: Have ideas for improvements?
- ๐ง Code Contributions: Submit pull requests with enhancements
- ๐ Documentation: Help improve our guides and examples
See our Contributing Guidelines for details.
๐ Credits
Laravel API Modules is crafted with โค๏ธ by WebMonks Technologies
- Lead Developer: Darshan Baraiya
- Company: WebMonks Technologies
Built With
- Laravel - The PHP Framework for Web Artisans
- PHP - A popular general-purpose scripting language
- SOLID Principles - Object-oriented design principles
- Repository Pattern - Clean architecture pattern
๐ License
This package is open-sourced software licensed under the MIT License.
All versions of laravel-api-modules with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
barryvdh/laravel-dompdf Version ^2.0 || ^3.0
twilio/sdk Version ^6.0|^7.0|^8.0