Download the PHP package eng-mohamedemad-dev/command-module-generator without Composer
On this page you can find all versions of the php package eng-mohamedemad-dev/command-module-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eng-mohamedemad-dev/command-module-generator
More information about eng-mohamedemad-dev/command-module-generator
Files in eng-mohamedemad-dev/command-module-generator
Package command-module-generator
Short Description Smart Laravel artisan module generator package - Generates complete modules (Model, Controller, Service, Repository, Policy, Observer, Views, Routes) with full automation and best practices
License MIT
Informations about the package command-module-generator
Laravel Module Generator Package# command-module-generator
Smart Laravel Artisan module generator package - Generates complete modules (Model, Controller, Service, Repository, Policy, Observer, Views, Routes) with full automation and best practices.### 📦 باكج توليد موديلات لارافيل ذكي وقابل للتخصيص الكامل
باستخدام أمر واحد فقط تقدر تولد:
---- Model
- Controller (API أو Web)
🌟 Features- Service
-
Repository & Interface
-
Full Module Generation: Create complete modules with Model, Controller, Service, Interface, Repository (optional), Policy, Observer, Views, and Resources- Request(s) (ملف أو ملفين)
-
API & Web Support: Automatically distinguishes between API and Web modules- Resource
-
Smart Route Registration: Auto-adds
Route::resourcewith proper imports to routes files- Policy -
Auto Binding: Automatically binds interfaces to services/repositories in ServiceProvider- Observer
-
Model Attributes: Uses modern PHP attributes for Policy and Observer registration- Views Blade (للوِب)
-
View Customization: Support for custom view paths via
--pathمع ربط كل شيء ببعضه تلقائيًا + حذف كل ذلك بنفس السهولة. -
Safe Overwriting: Protects existing files unless
--forceis used - Complete Cleanup: Delete command removes all traces (routes, views, bindings, attributes)---
---## التركيب السريع
📦 Installation1. أضف البكچ داخل مجلد packages في مشروعك
- ثبتها يدوياً في composer لو لزم الأمر
Install the package via composer:3. فعّل الـ ServiceProvider داخل config/app.php او سيعمل AutoDiscovery:
bash'providers' => [
composer require eng-mohamedemad-dev/command-module-generator ...
- انشر ملف الكونفج لتخصيص الخيارات:
- (اختياري) انشر stubs لتعديل قوالبك:
Generate a Module
أهم الميزات والخيارات الافتراضية
- تحكم في كل ما يتم توليده من خلال ملف
config/module-generator.php:
API Module - default_type: web/api
-
requests_mode: split (يولّد ملفين) أو single (ملف واحد) - أسماء ملفات الريكويستات (store/update)
Delete a Module
bash
| --type=web\|api | Select between web or API module (default: api) |
| --repo | Generate Repository + RepositoryInterface and bind to service |- أي خيار لم ترسله بالأمر، سيعمل بالقيمة الموجودة في الكونفج افتراضيًا.
| --path=custom | Custom view folder path (for web modules) |
| --force | Allow overwriting existing service, repository, and interface files |---
---## تخصيص قوالب (stubs) التوليد
- تستطيع نشر stubs عشان تعدل أي قالب توليد:
📁 Generated Structure
- غير في مجلد
stubs/command-module-generatorبحرية… كل توليد لاحق سيأخذ تعديلاتك!
Summary (EN)
For Web Modules (--type=web)A smart highly-configurable module generator for Laravel. Generate, clean up, and customize all module layers with one command. Full flexibility for your workflow!
Additional files:
🔧 How It Works
Service Layer Pattern
The package implements the Service Layer pattern for clean separation of concerns:
Auto Binding
Services and repositories are automatically bound in AppServiceProvider:
Modern Attributes
Uses PHP 8 attributes for Policy and Observer registration:
🎯 Best Practices
This package follows Laravel best practices:
- ✅ Route Model Binding for automatic model resolution
- ✅ Form Request Validation for clean controller code
- ✅ Resource Pattern for API transformations
- ✅ Service Layer for business logic separation
- ✅ Repository Pattern (optional) for data access abstraction
- ✅ Policy for authorization
- ✅ Observer for model events
- ✅ tap() Helper for fluent updates
📝 Examples
Example 1: Simple API Module
Generates a complete API module with:
- ProductController (API CRUD)
- ProductService
- ProductInterface
- ProductRequest
- ProductResource
- ProductPolicy
- ProductObserver
- Product Model with attributes
- Migration
- Auto-registered API routes
Example 2: Web Module with Custom Path
Generates web module with views in resources/views/admin/categories/
Example 3: API Module with Repository
Generates API module + Repository pattern implementation
🗑️ Delete Command
The delete command removes all generated files and cleans up:
- ✅ Model, Controller, Service, Repository, Interface
- ✅ Policy, Observer, Request, Resource
- ✅ Migration files
- ✅ Views (for web modules)
- ✅ Route registrations
- ✅ Service bindings in AppServiceProvider
- ✅ Model attributes (Policy/Observer imports and decorators)
🌍 Internationalization
This package supports both English and Arabic:
Arabic Commands
🔮 Roadmap
- [ ] Configuration file for customizing generated code
- [ ] Stub file publishing for custom templates
- [ ] GUI for module generation
- [ ] Seeders auto-generation
- [ ] ACL/Permissions integration
- [ ] Multi-language support in generated code
- [ ] Test file generation
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📄 License
This package is open-sourced software licensed under the MIT license.
👨💻 Author
Mohamed Emad
Email: [email protected]
GitHub: @eng-mohamedemad-dev
⭐ Support
If you find this package helpful, please give it a ⭐ on GitHub!
Made with ❤️ for the Laravel Community