PHP code example of saeedhosan / module-console

1. Go to this page and download the library: Download saeedhosan/module-console 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/ */

    

saeedhosan / module-console example snippets


Modules\Blog\BlogServiceProvider::class,

[
    'directory' => 'modules',      // Where your modules live
    'namespace' => 'Modules',       // The root namespace for modules
    'lowercase' => true,            // Normalize module names to lowercase
    'vendor' => 'modules',          // Vendor directory for module packages
    'view_path' => 'resources/views',
    'app_path' => 'app',
]
bash
php artisan vendor:publish --tag=module-stubs
bash
php artisan vendor:publish --tag=module-config
bash
php artisan make:module blog

modules/blog/
├── app/
│   └── BlogServiceProvider.php
├── config/
│   └── blog.php
├── database/
│   ├── factories/
│   ├── migrations/
│   └── seeders/
├── resources/
│   └── views/
├── routes/
│   └── web.php
├── tests/
│   └── example.php
├── composer.json
└── README.md
bash
php artisan make:model Post --module=blog
php artisan make:enum PostStatus --module=blog
php artisan make:controller PostController --module=blog
php artisan make:migration create_posts_table --module=blog
bash
php artisan make:YourMakeCommand YourClassName --module=ModuleName