Download the PHP package rayhan2001/module-generator without Composer
On this page you can find all versions of the php package rayhan2001/module-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rayhan2001/module-generator
More information about rayhan2001/module-generator
Files in rayhan2001/module-generator
Package module-generator
Short Description Laravel CRUD Module Generator (API + Web)
License MIT
Informations about the package module-generator
Laravel CRUD Module Generator
A powerful Laravel CRUD module generator that quickly scaffolds fully functional modules for both Web (Blade) and API applications. Generate complete CRUD operations with Model, Repository, Controller, Request, Migration, Routes, and Views in seconds.
This package is developer-friendly, supports direct repository injection in controllers, and provides configurable default type (web/api).
✨ Features
- 🚀 Complete CRUD Generation: Model, Repository, Controller, Request, Migration
- 🌐 Dual Module Types: Web (Blade) and API modules
- 💉 Direct Repository Injection: No interfaces needed
- 🛣️ Auto Route Generation: Clean group-controller format
- 🎨 Blade Views: Auto-generated views for web modules
- ⚙️ Configurable Defaults: Set default module type on installation
- 🔄 Force Overwrite: Overwrite existing files with
--forceflag - 📱 Laravel 9-12 Support: Compatible with latest Laravel versions
📦 Installation
Method 1: Via Packagist (Recommended)
Method 2: Via GitHub (Development)
Add the package repository to your composer.json:
Then install:
Method 3: Local Development
For local development, you can use a path repository:
⚙️ Configuration
After installation, run the setup command:
This will:
- Ask for your preferred default module type (
apiorweb) - Publish the configuration file to
config/module-generator.php - Set up the package for use
Example output:
🚀 Usage
Generate a new module
Available Commands
📁 Generated Files Structure
For a Category module, the following files will be generated:
🛣️ Generated Routes
Web Module Routes
API Module Routes
🎯 Example Usage
1. Generate an API Module
Generated Controller:
2. Generate a Web Module
Generated Controller:
🌐 Access Your Modules
Web Modules
- Index:
http://your-app.test/categories/ - Create:
http://your-app.test/categories/create - Edit:
http://your-app.test/categories/edit/1
API Modules
- Index:
http://your-app.test/api/products/ - Store:
POST http://your-app.test/api/products/store - Show:
http://your-app.test/api/products/1 - Update:
PUT http://your-app.test/api/products/update/1 - Delete:
DELETE http://your-app.test/api/products/delete/1
⚙️ Configuration
The package publishes a configuration file at config/module-generator.php:
🔧 Customization
Modify Generated Files
After generation, you can customize the generated files:
- Add columns to migration: Edit the migration file
- Add validation rules: Modify the Request classes
- Customize views: Edit the Blade templates
- Add business logic: Extend the Repository class
Example: Adding columns to migration
🐛 Troubleshooting
Common Issues
- Package not found: Make sure you've added the repository to
composer.json - Laravel version compatibility: Ensure you're using Laravel 9-12
- Permission issues: Check file permissions for generated files
- Route conflicts: Ensure route names don't conflict with existing routes
Getting Help
- Check the Issues page
- Create a new issue with detailed information
- Include Laravel version, PHP version, and error messages
📋 Requirements
- PHP: 8.0 or higher
- Laravel: 9.x, 10.x, 11.x, or 12.x
- Composer: Latest version recommended
🤝 Contributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Setup
📄 License
This package is open-sourced under the MIT License. See the LICENSE file for details.
🙏 Acknowledgments
- Built for the Laravel community
- Inspired by Laravel's built-in generators
- Thanks to all contributors and users
📊 Stats
All versions of module-generator with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0
illuminate/filesystem Version ^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0