PHP code example of nasirkhan / module-manager

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

    

nasirkhan / module-manager example snippets


use Nasirkhan\ModuleManager\Services\ModuleVersion;

$service = app(ModuleVersion::class);

$service->getVersion('Post');               // "1.0.0"
$service->getDependencies('Post');          // ['Category', 'Tag']
$service->dependenciesSatisfied('Post');    // bool
$service->getModulesByPriority();           // ordered module list

use Nasirkhan\ModuleManager\Services\MigrationTracker;

$tracker = app(MigrationTracker::class);

$tracker->trackModuleMigrations('Post', '1.0.0');
$tracker->getNewMigrationsSinceLastCheck('Post');
$tracker->getPendingMigrations('Post');
$tracker->hasUpdates('Post');
bash
php artisan vendor:publish --tag=post-migrations
php artisan vendor:publish --tag=post-views
php artisan vendor:publish --tag=post-config
php artisan vendor:publish --tag=post-lang
bash
composer dump-autoload
php artisan config:clear
bash
composer dump-autoload
php artisan cache:clear && php artisan config:clear
bash
php artisan module:track-migrations --force
php artisan module:detect-updates
php artisan vendor:publish --tag=post-migrations
php artisan migrate