PHP code example of khaledneam / module-generator

1. Go to this page and download the library: Download khaledneam/module-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

khaledneam / module-generator example snippets



Modules/
    Blog/
        Controllers/
        Models/
        Requests/
        Routes/
        Views/
        Migrations/
        Tests/
        Providers/
        Repositories/
        Services/

'providers' => [
    // Other Service Providers
    Modules\ModuleName\Providers\ModuleNameServiceProvider::class,
],
bash
{
    "autoload": {
        "psr-4": {
            "Modules\\": "Modules/"
        }
    },
    "files": [
        "app/helpers.php"
    ]
}


bash
composer dump-autoload

bash
php artisan make:module ModuleName
bash
php artisan make:module Blog
markdown
Service Provider: Modules/ModuleName/Providers/ModuleNameServiceProvider.php
Controller: Modules/ModuleName/Controllers/ModuleNameController.php
View: Modules/ModuleName/Views/index.blade.php
Route File: Modules/ModuleName/Routes/web.php
Repository: Modules/ModuleName/Repositories/ModuleNameRepository.php
Service: Modules/ModuleName/Services/ModuleNameService.php