🚀 Installation
Install the package via Composer:
composer require nahid-ferdous/laravel-module-generator --dev
📦 Service Provider
Generate required files and configurations:
php artisan module-generator:install
# or force install if you already have executed the command before
php artisan module-generator:install --force
What Gets Generated
The installation command creates the following files and configurations:
Core Files
- Useful Traits →
app/Traits/* - Global Exception Handler →
app/Exceptions/ExceptionHandler.php - Useful Helper Functions →
app/Helpers/*
Middleware
- Cors Middleware →
app/Http/Middleware/Cors.php- Handles Cross-Origin Resource Sharing (CORS) requests
- Auth Middleware →
app/Http/Middleware/Authenticate.php- Required to prevent "login route not defined" error when accessing protected routes without token
Configuration
- Dummy modules.yaml File →
module/modules.yaml