PHP code example of cesargb / laravel-modules

1. Go to this page and download the library: Download cesargb/laravel-modules 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/ */

    

cesargb / laravel-modules example snippets


use Cesargb\Modules\Modules;

Modules::all();            // all modules
Modules::installed();      // installed modules
Modules::uninstalled();    // uninstalled modules
Modules::get('my-module'); // specific module
Modules::isInstalled('my-module');
Modules::install('my-module');
Modules::uninstall('my-module');

$module = Modules::get('my-module');

$module->name;        // my-module
$module->packageName; // my-vendor/my-module
$module->version;     // ^1.0.0
$module->namespace;   // MyVendor\MyModule\
$module->installed;   // true/false

$module->install();
$module->uninstall();
bash
php artisan modules:config
bash
php artisan modules:download https://github.com/vendor/module.git
php artisan modules:download https://github.com/vendor/module.git --branch=main
php artisan modules:download https://github.com/vendor/module.git --tag=v1.0.0
php artisan modules:download https://github.com/vendor/module.git --name=my-module
bash
php artisan modules:list
bash
php artisan modules:install my-module
php artisan modules:install module1 module2
bash
php artisan modules:uninstall my-module
php artisan modules:uninstall module1 module2
bash
php artisan modules:test
php artisan modules:test --testdox
php artisan modules:test --filter=UserTest